My vimrc.
First, clone the vim package manager.
$ git clone https://github.com/VundleVim/Vundle.vim ~/.vim/bundle/Vundle.vim
Install packages.
$ vim +PluginInstall +qall
Install ctags (or may be called universal-ctags in some distributions).
$ sudo pacman -Syu ctags
Build ycm core. See here for more info.
$ cd ~/.vim/bundle/YouCompleteMe/
$ python3 install.py --{go,clangd,clang,rust}-completer
Skip these steps and delete the Plugin 'powerline/powerline' line if you have already had your powerline installed, and don't forget to set the powerline rtp by set rtp+=/PATH/TO/YOUR/POWERLINE/LIBRARY/bindings/vim.
- Install fonts from https://github.com/powerline/fonts.
$ git clone https://github.com/powerline/fonts /tmp/fonts
$ cd /tmp/fonts
$ ./install.sh
- Copy the config files to the default config path.
$ cp -r PATH_TO_THIS_REPO/powerline -t ~/.config
Skip these steps and delete the Plugin 'fatih/vim-go' line if you don't need to play with Golang.
- Install Golang tool chain.
$ sudo pacman -Syu go
- Install Golang helpers.
$ vim +GoInstallBinaries +qall
Skip this step and delete the Plugin 'rust-lang/rust.vim' line if you don't need to play with Rust:
$ sudo pacman -Syu rust
Refer https://github.com/SirVer/ultisnips for how to write your own snippets, or use the examples here.
Recommend install the silver searcher and fd to accelerate :Find and :Grep commands.
:Grep PATTERNto searchPATTERNin all files under current working directory, auto jump to the first result, and open the location list. The results are stored in the location list, see:h :lfile.- By default, the command only match a whole word, that is,
PATTERNshould be surrounded by non-word characters or start/end of line. :Grep PATTERN ifor case non-sensitive:Grep PATTERN wfor searching part of a word:Grep PATTERN hfor searching only in files with suffix ".h"- Multiple parameters are available, e.g.,
:Grep PATTERN iwh(order doesn't matter)
- By default, the command only match a whole word, that is,
:Find PATTERNto search files whose path matchesPATTERN.:Find PATTERN dfor searching directory. Since it searches "path", '/' is valid inPATTERN.- It searches case non-secsitively, and some regular expression are valid. For example,
:Find test_dir/.*\.pymatches the files under test_dir (recursively) and ends with ".py".
- It searches case non-secsitively, and some regular expression are valid. For example,
Yis mapped toy$to match the behavior ofD.F3in Normal mode to search the word under cursor recursively from current working directory.F3in Visual mode to search the select string.F4in Visual mode to mark the first exchange target, and one more time in Visual mode to perform exchange. See here for what is exchange.F4in Normal mode to unmark.F5in Normal mode to toggle NERDTreeF6in Normal mode to toggle tagbar
- In insert mode, the arrow keys
UP/DOWNare mapped to selecting the prev/next condidates. This helped me a lot to get used to keeping working in Normal mode instead of staying in Insert mode. - Function key
F7is mapped to "show documentation".
- Press
tabkey to trigger and forward,shift-tabto backward. See here for what is Ultisnips.