This guy did an awesome work with all the settings and plugins for VIM. I just forked his repo and edited what I needed for my setups.
I also added some other plugin :
- vim-gitgutter
- vim-fugitive
I use powerline, so you'll also find some settings related to it.
- For Debian/Ubuntu
sudo apt-get install vim-gtk exuberant-ctags git
[Check the equivalent packets names if you use another Linux distro] - Delete the .vim folder and the .vimrc file (if any) in the personal home directory :
rm -rf ~ / .vim ~ / .vimrc
- Use git to download the repo, then copy the subdirectory of the project in the personal home directory, and rename vimfiles to .vim, and _vimrc to .vimrc :
mv ~/vimrc/vimfiles ~/.vim && mv ~/vimrc/_vimrc ~/.vimrc
- You can download the Monaco font from https://github.com/todylu/monaco.ttf/blob/master/monaco.ttf?raw=true . Use the command
mv monaco.ttf ~/.fonts/.
to drop it into .fonts folder.
- If the shortcut keys do not respond to the situation, please check whether you have opened other software (such as Kingsoft, etc.), some software shortcuts and Vim may conflict, simply modify or disable the software shortcut keys.
- This configuration defaults to the relative row number. If you are not used to comment, you can comment out the set relativenumber in the configuration to use the absolute line number.
- If conditions permit, it is best to use universal-ctags instead of the old ctags.
- Some plugins require scripting language support, and if conditions permit, please install Lua, PHP, Python, Ruby, Node, TypeScript and other language operating environment
- Please try to use the latest version of Vim 8.x, the lower part of the function may not be used.
- First make sure that the system can find ctags, and that ctags is added to the system's path environment variable.
- While you are editing a souce file, type a small number of characters of some function and then press Ctrl + P to have a simple code completion.
- Move the cursor to the function name you want and press enter.
- Press Ctrl +] and VIM will automatically jump to the definition of the function.
- Press Ctrl + T to return to the location before the jump.
More than just ctags simple usage, more professional introduction please Google, and another more powerful weapon YouCompleteMe so you explore (this configuration does not integrate the plug-in, please install it)