zoukankan      html  css  js  c++  java
  • vim简单配置

    目录:

    一、安装插件管理神器:Vundle

    源码地址https://github.com/VundleVim/Vundle.vim

    安装方法:

    1、克隆到本机

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

    2、在本机用户目录下创建.vimrc文件

    set nocompatible              " be iMproved, required
    filetype off                  " required
    
    " set the runtime path to include Vundle and initialize
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    " alternatively, pass a path where Vundle should install plugins
    "call vundle#begin('~/some/path/here')
    
    " let Vundle manage Vundle, required
    Plugin 'VundleVim/Vundle.vim'
    
    " The following are examples of different formats supported.
    " Keep Plugin commands between vundle#begin/end.
    " plugin on GitHub repo
    Plugin 'tpope/vim-fugitive'
    " plugin from http://vim-scripts.org/vim/scripts.html
    " Plugin 'L9'
    " Git plugin not hosted on GitHub
    Plugin 'git://git.wincent.com/command-t.git'
    " git repos on your local machine (i.e. when working on your own plugin)
    Plugin 'file:///home/gmarik/path/to/plugin'
    " The sparkup vim script is in a subdirectory of this repo called vim.
    " Pass the path to set the runtimepath properly.
    Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
    " Install L9 and avoid a Naming conflict if you've already installed a
    " different version somewhere else.
    " Plugin 'ascenator/L9', {'name': 'newL9'}
    
    " All of your Plugins must be added before the following line
    call vundle#end()            " required
    filetype plugin indent on    " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    "
    " Brief help
    " :PluginList       - lists configured plugins
    " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
    " :PluginSearch foo - searches for foo; append `!` to refresh local cache
    " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
    "
    " see :h vundle for more details or wiki for FAQ
    " Put your non-Plugin stuff after this line

    使用方法:

    //需要安装插件的时候,在.vimrc文件中加入一行:
    Bundle 'your/script/path'
    
    //进入vim后运行以下命令
    :PluginInstall
    
    //或者在终端执行
    vim +PluginInstall +qall
    
    //卸载时只需:
    
    //去除配置文件中的 Bundle 'your/script/name'
    
    //在VIM中运行 
    :PluginClean

    二、配色方案:

    当前最受欢迎的是 Solarized 

    源码地址https://github.com/altercation/vim-colors-solarized

    安装方法:

    //克隆源码
    git clone git://github.com/altercation/vim-colors-solarized.git
    
    //复制到指定目录
    cp -rf vim-colors-solarized/colors/  ~/.vim/

    然后在.vimrc文件中加入以下代码:

    syntax enable
    set background=dark
    colorscheme solarized

    三、插件列表:

    导航与搜索

    自动补全

    语法

    四、遇到的问题:

    问题1:

    安装插件YouCompleteMe之后,报错“YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.3+) support...

    解决方法:

    sudo apt install vim-python-jedi

    问题2:

    安装插件YouCompleteMe之后,报错“the ycmd server shut down(restart wit . . . ”

    解决方法:

    //安装开发工具和CMake:
    sudo apt-get install build-essential cmake
    
    //确保安装了Python-dev:
    sudo apt-get install python-dev python3-dev
    
    //编译YCM 
    cd ~/.vim/bundle/YouCompleteMe
    ./install.py

    问题3:

    将vim中的内容复制到系统剪贴板

    解决方法: 

    安装图形化界面的vim,或者重新编译vim

    sudo apt-get install vim-gnome

    参考资料:

    https://github.com/Valloric/YouCompleteMe/issues/2573

    https://github.com/Valloric/YouCompleteMe#ubuntu-linux-x64

    https://blog.csdn.net/mergerly/article/details/51671890

    https://blog.csdn.net/zhangxiao93/article/details/53677764

  • 相关阅读:
    N!的位数
    c语言memset()函数
    通宵教室(ACM水题)
    欧拉函数+素数筛
    快速幂+大数取模
    观光浏览
    插入类排序(直接插入排序)
    showDoc使用方法
    $_POST与input('post.')区别
    “三日”面试官心得
  • 原文地址:https://www.cnblogs.com/minglex/p/9468269.html
Copyright © 2011-2022 走看看