Quick .vimrc editing and sourcing
Vim will set the MYVIMRC environment variable to the path of your vimrc on startup. You can verify this by running
:! env | grep VIM
This gives us the ability to do quick vimrc editing after adding something like this in your vimrc.
nnoremap <leader>ev :vs $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
You could change the to horizontal split if want with :sp, but you get the idea. Don't forget to source!
Tweet