set backspace=indent,eol,start syn on"语法高亮 set helplang=cn"使用中文帮助文档 set backspace=2 set tabstop=4"制表符的宽度 set softtabstop=4 setshiftwidth=4"缩进的空格 set autoindent "自动缩进 setcindent"C 插件 setnumber"设置行号 set ignorecase "忽略大小写 (查找字符串时) setnohlsearch"高亮显示 (查找字符串是,找到后高亮显示) set mouse=a"使用鼠标 set ruler "在右下角显示光标位置 set showcmd "显示未敲完的命令 set cmdheight=1"设定命令行的行数为 1 set laststatus=2"显示状态栏 (默认值为 1, 无法显示状态栏) set incsearch "在输入搜索的字符串同时就开始搜索已经输入的部分 "set nowrap "一行就一行,别弄到第二行去 set sidescroll=10"屏幕放不下时,按一次屏幕移动一个字符 set whichwrap=b,s,<,>,[,] "跨行移动 set fileformats=unix,dos set cursorline "突出显示当前行 set showmatch "插入括号时,短暂地跳转到匹配的对应括号 set matchtime=2"短暂跳转到匹配括号的时间 set smartindent "开启新行时使用智能自动缩进 filetype plugin indenton"自动识别文件类型,用文件类型plugin脚本,使用缩进定义文件 "set autochdir
插件
Vundle是vim的一个插件管理器, 同时它本身也是vim的一个插件。
插件管理器用于方便 & 快速的安装、删除、更新插件。
Vim Vundle插件官方地址i
set nocompatible " be iMproved, required filetype off " required
" set the runtime path to include Vundle and initialize set rtp+=~/.vim/Plugin/Vundle.vim call vundle#begin() "KeepPlugin commands between vundle#begin/end.
" let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' "Type1: plugin on GitHub repo Plugin'tpope/vim-fugitive'
" Type2: plugin from http://vim-scripts.org/vim/scripts.html "Plugin'L9'
" Type3: Git plugin not hosted on GitHub Plugin 'git://git.wincent.com/command-t.git' "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/'} "InstallL9and 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
这样 Vundle 就准备就绪了。
出错提示
如果在安装完插件后启动 vim 出现如下提示,则说明你的 vim 需要升级。
1
YouCompleteMeunavailable: requiresVim 7.4.1578+.
如果在安装完插件后启动 vim 出现如下提示,则说明你的 vim 需要重新编译以支持 Python。
1
YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or3.3+) support
编译指定版本 python 支持的 vim
再次使用 vim 编辑文件,如果出现下面警告:
1
YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or3.3+) support
那么需要你的VIM有Python的支持,这个是在一开始编译的选项里指定的。查看 vim 是否有 python 支持的具体操作如下: