vim:ftplugin:vim: Use local <buffer> autocmd
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
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
" 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 * source $MYVIMRC | echom "Reloaded" | redraw
|
||||
autocmd! BufWritePost <buffer> source $MYVIMRC | echom "Reloaded" | redraw
|
||||
augroup END
|
||||
|
||||
Reference in New Issue
Block a user