Skip to content

Instantly share code, notes, and snippets.

@averyvery
Created June 8, 2012 22:32
Show Gist options
  • Save averyvery/2898462 to your computer and use it in GitHub Desktop.
Save averyvery/2898462 to your computer and use it in GitHub Desktop.
A few things I wish I'd done as soon as I started with Vim
" relative linenumber. very helpful for "8yy"-style operations
set relativenumber
" once you get used to virtualedit=all, it's so great
set virtualedit=all
" setting this allows you to undo into previous sessions, all the way back to the start of a file
" (providing the path hasn't changed).
" very useful with the Vundle plugin
set undofile
set undodir=~/.vim/tmp/undo//
" keep your swp files out of working directories
" (remember to actually MAKE these dirs before setting this)
set backupdir=~/.vim/tmp/backup//
set directory=~/.vim/tmp/swap//
" quick project-search shortcut
nmap <leader>g :vimgrep // **/*.*<left><left><left><left><left><left><left><left>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment