Vundle Installation
Clone Vundle to local
1 | $ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim |
Modify ~/.vimrc
Put this at the top of your .vimrc
to use Vundle. Remove plugins you don’t need, they are for illustration purposes:
1 | set nocompatible " be iMproved, required |
Note: All Plugin should be added between call vundle#begin()
and call vundle#end()
.
After saving and exiting, revoke vim with sudo, then type command :PluginInstall
The NERDTree
The NERDTree is a file system explorer for the Vim editor. Using this plugin, users can visually browse complex directory hierarchies, quickly open files for reading or editing, and perform basic file system operations.
Installation
Add Plugin 'scrooloose/nerdtree'
in your ~/.vimrc
.
Then run :PluginInstall
in Vim.
Finally, you can call it through :NERDTree
.
YouCompleteMe
YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim.
Installation
Add Plugin 'valloric/youcompleteme'
in your ~/.vimrc
.
Then run :PluginInstall
in Vim.
Compilation
If you try to run vim now, there will be one prompt message at the bottom:
The ycmd server SHUT DOWN (restart with ‘:YcmRestartServer’). Unexpected error while loading the YCM core library. Use the ‘:YcmToggleLogs’ command to check the logs.
Change working directory to ~/.vim/bundle/YouCompleteMe
.
Compiling YCM with semantic support for C-family languages:
1 | $ cd ~/.vim/bundle/YouCompleteMe |
Compiling YCM without semantic support for C-family languages:
1 | $ cd ~/.vim/bundle/YouCompleteMe |
For other languages support options, please refer to the official installation guide.
However, after compiling with support for C-family languages, when opening vim again, there’s still one message:
No .ycm_extra_conf.py file detected, so no compile flags are available. Thus no semantic support for C/C++/ObjC/ObjC++.
Now we need to give YCM one .ycm_extra_conf.py
.
The easiest way is to use the one under path /Users/XXX/.vim/bundle/youcompleteme/third_party/ycmd
.
mkdir cpp
in YouCompleteMe
folder and copy the config file into it.
Of course, you could also manually config .ycm_extra_conf.py
.
Last, add this line into your ~/.vimrc:
1 | let g:ycm_global_ycm_extra_conf='/Users/XXX/.vim/bundle/youcompleteme/cpp/.ycm_extra_conf.py' |
Have fun!