From 39df04144304ef729e5bf86e7a2a3b34aab8ac89 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 3 Jun 2022 21:57:17 +0200 Subject: [PATCH] vim:ftplugin:vim: Use local `` 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 --- .config/vim/ftplugin/vim.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/vim/ftplugin/vim.vim b/.config/vim/ftplugin/vim.vim index d767ace..83624f0 100644 --- a/.config/vim/ftplugin/vim.vim +++ b/.config/vim/ftplugin/vim.vim @@ -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 source $MYVIMRC | echom "Reloaded" | redraw augroup END