Files
dotfiles/.config/vim/ftplugin/vim.vim
Julian Prein 39df041443 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
2022-07-12 21:00:04 +02:00

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