2014年8月26日星期二

vim插件的安装和管理

今天晚上在一篇博客中看到有关安装vim插件的用法,心血来潮下自己在CentOS 6.5下试了下,走了一点点的弯路,就把步骤记录下来吧!!以便以后再次能迅速搭建环境!!
vim下vundle是一款管理插件的神器,能够管理众多的vim插件,安装方法如下:
#git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
然后在/etc/vimrc中添加如下代码
set nocompatible "与vi不一致
filetype off
set rtp+=~/.vim/bundle/vundle/ "载入特定目录插件
"set rtp+=$HOME/.vim/bundle/vundle/ "Windows下
call vundle#rc()
"plugin 
"vimscripts账号下的项目直接填写名称即可
Bundle 'snipMate'
"其它需填写用户/资源名称
Bundle 'gmarik/vundle'
"非github上资源
Bundle 'git://git.wincent.com/command-t.git'
"indent
Bundle 'php.vim-html-enhanced'
"color
Bundle 'Lucius'
filetype plugin indent on
启用vundle,然后安装可以使用vundle管理的插件,例如powerline。
安装方法:
#cd ~/.vim/bundle/
#git clone https://github.com/Lokaltog/vim-powerline
在vimrc中添加如下代码:
set t_Co=256
Bundle 'vim-powerline'
set laststatus=2
let g:Powerline_colorscheme='solarized256'
重启vim,可看到如下图所示:

没有评论:

发表评论