Vundle is the short-for- vim bundle and is a VIM plugin manager.
Set up Vundle:
- from git Download and download Vundle
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/vundle.vim
Put this on the top of your. VIMRC to use Vundle. Remove plugins you don ' t need, they is for illustration purposes.
Set nocompatible "be improved, required
FileType off "required
"Set the Runtimepath to include Vundle and initialize
Set Rtp+=~/.vim/bundle/vundle.vim
Call Vundle#begin ()
"Alternatively, pass a pathwhere vundle should install plugins
"Callvundle#begin (' ~/some/path/here ')
Let Vundle managevundle, required if you want to add bundles, add them in the following format
Plugin ' Vundlevim/vundle.vim '
"The following areexamples of different formats supported.
"Keep Plugin commands betweenvundle#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 You R Local Machine (i.e-working on your own plugin)
plugin ' file:///home/gmarik/path/to/plugin '
"the Sparkup vim Script is in asubdirectory of this repo called Vim.
Pass the path to set Theruntimepath properly.
Plugin ' Rstacruz/sparkup ', {' RTP ': ' vim/'}
"Install L9 and avoid a namingconflict if you ' ve already installed A
"different version somewhereelse.
Plugin ' Ascenator/l9 ', {' name ': ' NewL9 '}
"All of Yourplugins must is added before the following line
Call Vundle#end () "Required
FileType plugin indent on "required
"To ignore plugin indentchanges, instead use:
"FileType plugin on
"
"Brief help Below is the command in VI
":P luginlist-lists configured Plugins
":P Lugininstall-installs plugins; Append '! ' to update orjust:P luginupdate
":P luginsearch foo-searchesfor foo; Append '! ' to refresh local cache
":P luginclean-confirms removal of unused plugins;append '! ' to auto-approve removal
"
"See:h vundle for more detailsor wiki for FAQ
"Put your non-plugin stuff afterthis line
If you want a simple configuration, this step can be directly CP~/.VIM/BUNDLE/VUNDLE.VIM/TEST/VIMRC ~/.vimrc,test has written a simple test configuration use case, the following is a few other VI configuration examples
Setnumber
Setautoindent
Setcindent
Syntaxenable
Syntaxon
"Setc_co=256
Setbackspace=indent,eol,start
Settabstop=4
Setshiftwidth=4
Setsmarttab
"Setsoftabstop=4
Setexpandtab
Setencoding=utf-8
Setfileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
Filetypeon
Filetypeindent on
Filetypeplugin Indent on
3. add in ~/.VIMRC
1 |
Bundle ' Valloric/youcompleteme ' |
Youcompleteme
4. Open vim, enter command
The bundles added in ~/.VIMRC are automatically downloaded, and this is Youcompleteme
5. After the installation is complete, the youcompleteme will need to be compiled and installed
1 2 |
CD ~/.vim/bundle/youcompleteme ./install--clang-completer |
If there is an error in this case and you report a Python library error, you may need to install Python-dev
When you open vim, you are prompted to No. ycm_extra_conf.py file detected, so no compile flags is available. Thus no semantic support for c/c++/objc/objc++. Then I have not understood what the meaning, went to the author of the project home page, the author is very enthusiastic, very serious reply to my question. Finally combined with the author's suggestions, and then self-check the document, in fact, the solution is very simple, only need to set the location of the. ycm_extra_conf.py file, add the following in the. virmc file Let g:ycm_global_ycm_extra_conf = ' ~/. Vim/bundle/youcompleteme/cpp/ycm/.ycm_extra_conf.py ', then re-open vim
From
The following part has not changed.
In order to complete the C + + code, under Linux we need to modify the flags section of the. ycm_extra_conf.py file, use the-isystem to add the system's header file for parsing, use-I to add a third-party header file for parsing, after the Flags section add the following:
- '-isystem ',
- '/usr/include ',
- '-isystem ',
- '/usr/include/c++/4.8 ',
Ten. '-isystem ',
One. '/usr/include ',
'/usr/include/x86_64-linux-gun/c++ ',
From
Bundle ' Scrooloose/nerdcommenter '
This plugin is a comment plug-in, you can \cc comments, uncomment with \CU
Code jump can bind a shortcut key: Nnoremap <leader>jd:ycmcompleter Gotodefinitionelsedeclaration<cr>, well understood, first jump to definition, if not found, jumps to the declaration. \jd
From
: Help map can get access to VI's shortcut keys related to helpful documents
For example letleader= ", '
Nnoremap <leader>jd:YcmCompleterGoToDefinitionElseDeclaration<CR> would have to press \JD to go to the definition of the variable, so now just press, JD will be
Set the color of an annotation
Highlight Comment Ctermfg=green Guifg=green
From
VI Installation vundle+youcompleteme+ notes Quick bundle ' scrooloose/nerdcommenter '