Vundle是vim的一個插件管理器, 同時它自己也是vim的一個插件,能夠搜索、安裝、更新、清理插件。Vundle的安裝須要git和curl的支持。若是沒有上述兩個套件能夠先下載。yum install crul
yum install git
html
首先下載所需文件linux
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
修改~/.vimrc
文件,若是你不是root用戶,那麼請修改對應用戶目錄下的.vimrc
文件,好比用戶名是bar,請修改/home/bar/.vimrc
文件,沒有.vimrc
文件就建立一個。git
將如下文本追加到.vimrc
文件中github
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/'} " Avoid a name conflict with L9 Plugin 'user/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 - list configured plugins " :PluginInstall(!) - install (update) plugins " :PluginSearch(!) foo - search (or refresh cache first) for foo " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line
:PluginInstallvim
Vundle會自動安裝配置文件裏 call vundle#begin()
和call vundle#end()
之間記錄的插件,安裝完成後會顯示done
。過程可能有點費時間。segmentfault
在命令行中輸入:vim +PluginInstall +qall
,等待一段時間直到顯示done
windows
用vim打開源碼文件,將光標放在要查看的函數上,Ctrl+]
能夠跳轉,Ctrl+t
能夠返回,若是有多個跳轉選項,按數字鍵選擇跳轉到哪個。app
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
Error detected while processing /root/.vimrc:
line 14:
E492: Not an editor command: Plugin 'VundleVim/Vundle.vim'
line 19:
E492: Not an editor command: Plugin 'tpope/vim-fugitive'
line 23:
E492: Not an editor command: Plugin 'git://git.wincent.com/command-t.git'
line 28:
E492: Not an editor command: Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Press ENTER or type command to continue
這種狀況多是使用命令 vi
時纔出現而使用vim是不出現,這是因爲vi並非vim而使用vi時會讀取$HOME/.vimrc
配置文件,能夠經過設置別名解決curl
alias vi=vim
也多是你直接複製了windows上的配置文件$HOME/.vimrc
到linux,而windows中的換行符是/r/n,linux的換行符是/n。因此應該改配置文件$HOME/.vimrc
參考連接:
https://stackoverflow.com/questions/24185580/vundle-e492-not-an-editor-command-plugininstall
https://segmentfault.com/a/1190000003795535?utm_source=tag-newest函數
Vundle官網: https://github.com/VundleVim/Vundle.vim
引用: https://www.jianshu.com/p/1839f1fb3f08