aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-09 17:28:31 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-09 17:28:31 +1200
commitc30d6d886f5763b44dd3fcd4eb14c3763484c3bb (patch)
tree61fd423624981bdeb7edcd91f91917118cb76388
parentRemove 'showmatch' again (diff)
downloaddotfiles-c30d6d886f5763b44dd3fcd4eb14c3763484c3bb.tar.gz
dotfiles-c30d6d886f5763b44dd3fcd4eb14c3763484c3bb.zip
Add $MYVIM/vimrc hook conditionally
-rw-r--r--vim/vimrc6
1 files changed, 5 insertions, 1 deletions
diff --git a/vim/vimrc b/vim/vimrc
index ae662521..cf7b752c 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -160,8 +160,12 @@ augroup END
" apply immediately in the current editing session. This often makes broken
" changes immediately apparent.
"
-autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc
+autocmd vimrc BufWritePost $MYVIMRC
\ source $MYVIMRC
+if $MYVIMRC !=# ''
+ autocmd vimrc BufWritePost $MYVIM/vimrc
+ \ doautocmd vimrc BufWritePost $MYVIMRC
+endif
" Similarly, if this file or the vimrc stub that calls it is sourced, whether
" because of the above hook, or the <Leader>R mapping prescribed later in this