首页 > 代码库 > ubuntu下配置vim及插件

ubuntu下配置vim及插件

1、首先要安装vim,默认ubuntu是未安装vim的

 

sudo apt-get install vimsudo apt install vim

2、为了安装pathogen插件,新建文件夹,切换到.vim下,执行git init 

mkdir ~/.vimmkdir ~/.vim/{autoload,bundle}cd .vimsudo apt install gitgit init

Initialized empty Git repository in /home/cloudor/.vim/.git/  表示成功

3、安装过程,先下载vim-pathogen,下载地址 https://github.com/tpope/vim-pathogen   也可以直接执行如下语句

curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

 然后添加下面的命令到~/.vimrc文件中,如果文件不存在,先创建它

vim ~/.vimrc

写入如下内容

execute pathogen#infect()syntax onfiletype plugin indent on

执行语句,安装sensible.vim

cd ~/.vim/bundlegit clone git://github.com/tpope/vim-sensible.gitCloning into vim-sensible...remote: Counting objects: 285, done.remote: Total 285 (delta 0), reused 0 (delta 0), pack-reused 285Receiving objects: 100% (285/285), 41.81 KiB | 48.00 KiB/s, done.Resolving deltas: 100% (72/72), done.Checking connectivity... done.

新插件安装到bundle目录下后,如果插件中包含doc,则需要在Vim中运行:Helptags来生成在线帮助tags

我建议依次安装和学习如下插件:vim-sensible, vim-airline, vim-abolish, ctrlp.vim, UltiSnips, vim-surround, vim-easy-align

参考资料    http://blog.csdn.net/wxqee/article/details/46911857

  http://www.cnblogs.com/zhcncn/p/4030576.html

  

 

 

 

ubuntu下配置vim及插件