Skip to content

Instantly share code, notes, and snippets.

@robert-claypool
Last active January 15, 2016 07:12
Show Gist options
  • Save robert-claypool/306df964cb6443a7334b to your computer and use it in GitHub Desktop.
Save robert-claypool/306df964cb6443a7334b to your computer and use it in GitHub Desktop.
My notes on Vim

My notes on Vim

  • Where is this Vim installed? Within Vim, run :echo $VIM
  • The home directory is $HOME. Within Vim, enter :echo $HOME or :echo ~
  • A history of Vim commands is in $HOME/_viminfo. Within Vim, enter : and then and to cycle through history
  • :scriptnames lists files that Vim loaded for you, including your .vimrc file
  • .vimrc is not created for you by most installations. Create one and save it in $HOME
  • To edit your configuration in Vim, enter :e $HOME/.vimrc or :e ~/.vimrc (tilde is an alias of HOME)
  • The Vim installed as part of msysgit does not have syntax files for most languages. To fix this, install Vim for Windows (gvim) and copy syntax files over from one installation to the other, e.g. ~\Program Files (x86)\Vim\vim74\syntax -- to --> ~\Program Files (x86)\Git\share\vim\vim74\syntax. Another option is to go into ~\Program Files (x86)\Git\bin\ and edit the vim and vi files to run your gvim installation of Vim instead.
  • Git for Windows (msysgit) calls a shell script /bin/vim to locate and run Vim. Edit this file if you want to change the default.
  • :set syntax=whitespace is a hack to see spaces/tabs highlighted as red/green. Use :set syntax=JavaScript (or whatever) to go back. http://stackoverflow.com/a/19012475/23566
  • Window switching! Control+W H/J/K/L.
  • Colors: http://codeyarns.com/2011/07/29/vim-chart-of-color-names/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment