Skip to content

Instantly share code, notes, and snippets.

@canabady
Last active February 6, 2017 06:47
Show Gist options
  • Save canabady/bb7d1aee2db52230046d54579343d2ae to your computer and use it in GitHub Desktop.
Save canabady/bb7d1aee2db52230046d54579343d2ae to your computer and use it in GitHub Desktop.
Shortcut for editing and sourcing VIMRC
" Quickly edit/reload VIMRC configuration file
nnoremap gev :e $MYVIMRC<CR>
nnoremap gsv :so $MYVIMRC<CR>
if has ('autocmd') " Remain compatible with earlier versions
augroup vimrc " Source vim configuration upon save
autocmd! BufWritePost $MYVIMRC source % | echom "Reloaded " . $MYVIMRC | redraw
autocmd! BufWritePost $MYGVIMRC if has('gui_running') | so % | echom "Reloaded " . $MYGVIMRC | endif | redraw
augroup END
endif " has autocmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment