aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-09 15:54:28 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-09 16:17:33 +1200
commite88643652f20e1020d2b7269bd9506834b89b28c (patch)
tree9d4ff826ccebe4e2c43899f68bac35a7170eb5f1
parentRefactor filetype reloading with command (diff)
downloaddotfiles-e88643652f20e1020d2b7269bd9506834b89b28c.tar.gz
dotfiles-e88643652f20e1020d2b7269bd9506834b89b28c.zip
Check value of MYVIM before hooking into subfile
-rw-r--r--vim/vimrc6
1 files changed, 5 insertions, 1 deletions
diff --git a/vim/vimrc b/vim/vimrc
index dbf2e5da..0daff902 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -170,8 +170,12 @@ command! FileTypeReload
" that they only run once.
"
if exists('##SourceCmd')
- autocmd vimrc SourceCmd $MYVIMRC,$MYVIM/vimrc
+ autocmd vimrc SourceCmd $MYVIMRC
\ source <afile> | FileTypeReload
+ if $MYVIM !=# ''
+ autocmd vimrc SourceCmd $MYVIM/vimrc
+ \ doautocmd vimrc SourceCmd $MYVIMRC
+ endif
endif
" Keep the viminfo file in a cache subdirectory of $MYVIM, creating that