尝试了一段时间的vim,终究不如IDE好用,找不到黑客的感觉。实在忍不了一天天苦练vim的命令了,先找找插件感受一下vim的灵活吧,至少往IDE的感觉上靠一靠,也能凑合先代替IDE进行开发呀。
vim的插件都放在~/.vim路径下,但不是很好管理,网上说vundle是个不错的vim插件管理工具,尝试下,的确不错,该项目托管在github上,README已经讲的蛮清楚了,github路径如下:
首先下载vundle
git clone
https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
然后是配置插件
配置信息主要写在~/.vimrc中,示例内如如下,其中单个双引号表示注释。
set nocompatible " be iMproved, required
file type 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 examlpes 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'
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}
" All of your Plugins must be add before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent chanes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - install 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
这个例子中给出了各种添加插件的方式,比如从github添加,从本地添加,从vim-scripts.org网站上添加,从其他git服务器上添加等。最常用的应该就是从github上添加了。看起来用vundle管理vim插件的方式还是不错的,只需要保存.vimrc这个文件,就可以在不同的机器上同步自己的配置了。
配置文件写好后,就是安装插件
在vim中执行命令
:PluginInstall,然后就会看到左半屏幕开始安装插件,但是如果有找不到的插件会卡住,恐怕需要关掉vim然后修改.vimrc文件。
也可以在命令行中安装插件,命令为:
vim +PluginInstall +qall
也可以在vim中查看vundle的帮助,命令为
:h vundle