From 466a52130e0bf076cf19ba5a6fb181105b2b1442 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 8 Jun 2019 22:40:49 +1200 Subject: More detail on vimrc re-sourcing --- vim/vimrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vim/vimrc') diff --git a/vim/vimrc b/vim/vimrc index 1641b36b..c843e0a1 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -115,8 +115,12 @@ autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc if exists('##SourceCmd') " We can't wrap this in a script-local function like I normally would, - " because then Vim will get upset that we're trying to redefine it the next - " time it loads. It's only four commands, anyway. + " because without a load guard around it, Vim will get upset that we're + " trying to redefine that function the next time this script loads. + " + " So, we just inline the whole thing into the hook. It's only four + " commands, anyway, and I'd rather most if not all of the vimrc was reloaded + " when we source it. " autocmd vimrc SourceCmd $MYVIMRC,$MYVIM/vimrc \ source -- cgit v1.2.3