首页 > 代码库 > [Tools] Vim插件管理
[Tools] Vim插件管理
我们在使用插件的时候,都不希望插件安装的很杂乱,它不是一个看不见的黑盒,也为了下次方便在其它地方安装。
由于要方便插件管理,于是有了 Vundle,以下做些介绍:
1. 一个插件管理器, 自己本身也是插件, 这是必需工具:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2. Vundle 在 .vimrc 中通过以下配置项来管理其它插件:
"##################################/ Vundle.vim ###################################" https://github.com/VundleVim/Vundle.vimset nocompatible " be iMproved, requiredfiletype off " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin(‘~/some/path/here‘)" let Vundle manage Vundle, requiredPlugin ‘VundleVim/Vundle.vim‘ " 插件管理, 必需" The following are examples of different formats supported." Keep Plugin commands between vundle#begin/end." plugin on GitHub repo"Plugin ‘tpope/vim-fugitive‘Plugin ‘scrooloose/nerdtree‘ " 目录树,https://github.com/scrooloose/nerdtree/blob/master/doc/NERD_tree.txt" plugin from http://vim-scripts.org/vim/scripts.htmlPlugin ‘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‘, {‘rtp‘: ‘vim/‘}" Install L9 and 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 linecall vundle#end() " requiredfiletype 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 ###################################" 映射ctrl+v 到:NERDTreeToggle+回车map <C-V> :NERDTreeToggle<CR>
配置含义和常规命令在上面的注释里写的很清楚,有必要仔细看一下.
3. 终端输入vim打开空白页,用 :PluginInstall 安装配置中的插件;如需卸载,先把插件名注释掉,用 :PluginClean 卸载.
上面只是些介绍,配置好的文件在这里:https://github.com/farwish/vimrc.git,将目录内的 .vimrc 覆盖当前用户的,然后进行安装.
学会了这种配置方式,找些强大的插件,也许就不需要IDE了.
@黑眼诗人 <farwish.com>
Link: http://www.cnblogs.com/farwish/p/5792884.html
[Tools] Vim插件管理
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。