VIM插件安装

来源:互联网 发布:软件研究生大学排名 编辑:程序博客网 时间:2024/06/14 20:23

一、VIM 插件管理器安装 -- Vundle

Vundle项目地址:https://github.com/VundleVim/Vundle.vim

按照项目中的说明配置好Vundle


需要某个插件时,只需在.vimrc中添加即可。按添加的路径写法,可将插件分3类:

  • 在Github vim-scripts 用户下的repos,只需要写出repos名称
  • 在Github其他用户下的repos, 需要写出”用户名/repos名”
  • 不在Github上的插件,需要写出git全路径

在.vimrc中配置好后,使用以下命令操控插件的安装、更新、删除:

  • 安装插件:BundleInstall
  • 更新插件:BundleUpdate
  • 清除不再使用的插件:BundleClean,
  • 列出所有插件:BundleList
  • 查找插件:BundleSearch


二、VIM 配色,以solarized配色为例

尝试了2种配色,solarized和vim-coloresque。这2种配色的安装步骤有所不同。

1. solarized

solarized项目地址:git://github.com/altercation/solarized.git。

在.vimrc的合适位置添加:Plugin 'altercation/solarized',保存退出。

打开vim,使用命令:BundleInstall,安装solarized配色。

在.vimrc中添加:

colorscheme solarizedset background=dark
保存退出vim,再次打开,报错。解决方法是将配色文件solarized.vim拷贝到.vim/colors目录下。

2. vim-coloresque

在.vimrc的合适位置添加:Plugin 'axiaoxin/favorite-vim-colorscheme',保存退出。

打开vim,使用命令:BundleInstall,安装vim-coloresque配色。

在.vimrc中添加:

colorscheme Tomorrow-Night-Brightset background=dark


三、状态栏增强 -- vim-airline

vimrc配置如下:

Bundle 'bling/vim-airline'set laststatus=2
打开vim,使用命令:BundleInstall,安装vim-airline。

原创粉丝点击