vim_config
Configurations and plugins for Vim.
1. Setup Vim
Using git to track dotfiles
$ mv .vimrc ~/.vim/vimrc
$ ln -s ~/.vim/vimrc ~/.vimrc
$ cd ~/.vim
$ git init
$ git add .
$ git commit -m "Initial commit"
Install configurations on a new machine
- Linux
$ cd ~
$ git clone https://github.com/rxdu/vim_config.git ~/.vim
$ ln -s ~/.vim/vimrc ~/.vimrc
$ cd ~/.vim
$ git submodule update --init --recursive
- MacOS
$ sudo port install vim +python27 +huge
#Add an alias in the ~/.bash_profile
alias vim='/opt/local/bin/vim'
Additional setups
- Colorscheme
Add the following variable to .bashrc to show color correctly.
export TERM=xterm-256color
Plugin dependencies
ctags: required by Gutentags, TagBar
- Linux
$ sudo apt-get install exuberant-ctags
- MacOS
$ brew install ctags-exuberant
2. Manage plugins
See PLUGIN
3. Using vim
See CHEATSHEET
4. Plugins installed
- Pathogen: runtime path management
- vim-cpp-modern: C++ highlight
- Vim-Clang-Format: format code using clang-format
- Gutentags: quick reference to symbols/functions
- TagBar
- c.vim: C/C++ support
- vim-code-dark: vs code dark color scheme
- lightline: a better-looking status bar
- CtrlP: file/buffer quick search/switch
- vim-cmake
- vim-markdown
- nerdtree
- fugitive: git support
- vim-multiple-cursors
- vim-eunuch
- vim-surround
- ale: linting/fixing
- vim-clang: parse and complete C/C++ source files
- vim-buftabline
Vim-Cpp-Enhanced-Highlight: C++ highlightcolorsbox: color scheme for VIM (not used by default)vim-colors-solarized - terminal color schemeYouCompleteMe: auto completionYCM-Generator: YouCompleteMe configuration file generator
5. Candidnate plugins
Reference:
Configuration
- http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/
- http://www.nils-haldenwang.de/frameworks-and-tools/git/how-to-ignore-changes-in-git-submodules
- http://dougblack.io/words/a-good-vimrc.html
- https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9
Plugin documentation
Resource