Fix the issue that the vim config would always be reloaded on save (jumping to the BOF; another TODO) even in non `*.vim` buffers, after a vim file was opened once in the session. Fix this by defining the autocmd only local to the current buffer. See also :help autocmd-buflocal
7 lines
302 B
VimL
7 lines
302 B
VimL
" Source config upon saving vim file.
|
|
" Group to avoid "exponential" reloading. See:
|
|
" https://stackoverflow.com/questions/2400264/is-it-possible-to-apply-vim-configurations-without-restarting
|
|
augroup vimrc_reload
|
|
autocmd! BufWritePost <buffer> source $MYVIMRC | echom "Reloaded" | redraw
|
|
augroup END
|