JaredVogt / vimrc

CONFIG: my vimrc
0 stars 0 forks source link

implement - automatically reload .vimrc on changes #19

Closed JaredVogt closed 8 years ago

JaredVogt commented 8 years ago
augroup myvimrc
    au!
    au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
augroup END

http://stackoverflow.com/questions/2400264/is-it-possible-to-apply-vim-configurations-without-restarting/2403926#2403926

This isn't exactly what I want though - this reloads on when saving .vimrc - what I really want is something that notices when .vimrc is replaced (could be from shell).

JaredVogt commented 8 years ago

this is done... sources both .vimrc and .gvimrc on save (of .vimrc...)

augroup myvimrc
    autocmd!
    autocmd BufWritePost .vimrc,.gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
    :echo "Sourced rc files"
augroup END