Setting up Vim

Feb 13, 2017  

These are my settings for Vim, and will be occasionally updating as I refine the settings.

Cheatsheet for cusom mappings

Custom Shortcut Effect
[space] s Vertically split window
[space] c Close panel (split window)
[space] w Remove spaces at end of line
jj Go back to normal mode (from insert mode)
[space] a Search with Silver Searcher (:Ag)
[space] o Open a new file (opens quick search panel)
[space] y Yank selected text to the clipboard
[space] p Paste text from the clipboard
[space] ev Edit vimrc (use “:so %” to test changes within .vimrc)
[space] h,j,l,l Move between splits left, down, up, right respectively
[control] n Toggle NERD tree [space] n also mapped

The code

To make use of them you can either copy / paste sections of the content and add to your ~/.vimrc file, or:

git clone https://gist.github.com/00eb397b07c2c38f00e1c523c342a3cd.git dotvimrc

From there you may run install.sh which simply creates a symbolic link to the .vimrc file.

Hint: Once you have opened the .vimrc file in vim, you can either mark it with mV and subsequently reload it with 'V, or use the [space]ev shortcut as defined in the sample file here.

Additional Notes

  • Install the optional JS linter with sudo npm install -g jshint
  • Install the python linter with pip install vim-vint
  • sudo apt-get install ag to get the excellent Silver Searcher as used by NERDTree