Last active
February 6, 2017 06:47
-
-
Save canabady/bb7d1aee2db52230046d54579343d2ae to your computer and use it in GitHub Desktop.
Shortcut for editing and sourcing VIMRC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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