您的位置:首页 > 其它

vim插件vundle实战

2018-01-21 17:57 375 查看

vim加装Bundle(vundle)插件管理工具

Vundle(https://github.com/VundleVim/Vundle.vim)的全称是Vim Bundle,它是一款Vim插件管理工具。Vundle让你可以非常轻松地安装、更新、搜索和清理Vim插件。它还能管理你的运行时环境,并帮助标记。

安装vundle

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim


ok了,vundle已经被安装到你的~/.vim/bundle/vundle目录下了

配置vimrc

vim打开~/.vimrc

set nocompatible              " be iMproved, required
filetype 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 examples 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', {'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 line
call vundle#end()            " required
filetype 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


要安装的插件直接以Plugin ‘XXX’的形式写入该配置文件即可

关于具体‘XXX’的地址形式,可以参看官方说明:一般官方的插件,只需写插件名字就行;普通github上的插件,需要写具体github地址

安装插件

进入vim,输入

:PluginInstall


卸载vundle

同样,输入

:PluginClean


搜索插件

:PluginSearch <text-list>


github地址:vundle插件

举例

安装nerdtree

~/.vimrc中添加

Plugin 'The-NERD-Tree'


配置nerdtree快捷键

在vimrc中添加

map <F1> :NERDTreeToggle


即可在vim中按F1打开左侧目录

ctrl+w+w:光标自动在左右侧窗口切换
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: