From 935c9f17cd6b5d9f8b6f1e4218203c0d35c0b2be Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Fri, 7 Apr 2023 22:51:31 +0200 Subject: [PATCH] Improve config reloading --- .vimrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 5b7b109..18bfb75 100644 --- a/.vimrc +++ b/.vimrc @@ -494,8 +494,6 @@ endfu " VIM config hot reload -au! bufwritepost .vimrc source $HOME/.vimrc - " TODO: separate to filetype specific files " JS @@ -544,3 +542,9 @@ augroup HiglightTODO autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', 'FIXME', -1) autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', 'QUESTION', -1) augroup END + +augroup Vim + au! + " Reload vim config when ~/.vimrc is changed + au BufWritePost $HOME/.vimrc so $MYVIMRC | redraw | echo "Reloaded vimrc" +augroup END