vim: Move autosource of config into ftplugin

Instead of only sourcing the vim config when vimrc or $MYVIMRC (xdg.vim)
is edited, reload always when saving a vim file.
This is a test. But I think it makes sense since I never edit a vim file
that is not sourced by my config in any way. Thus reloading should be
always appropriate.
This commit is contained in:
2020-09-23 02:25:04 +02:00
parent 1c2035f458
commit 0a2d70412e
2 changed files with 6 additions and 5 deletions

View File

@@ -0,0 +1,6 @@
" 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 * source $MYVIMRC | echom "Reloaded" | redraw
augroup END

View File

@@ -159,10 +159,5 @@ else
endif
endif
" Source edited vim config upon saving.
augroup vimrc
autocmd! BufWritePost $MYVIMRC,vimrc source % | echom "Reloaded" | redraw
augroup END
" Load filetype plugins
filetype plugin indent on