aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-09 15:52:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-09 16:17:33 +1200
commita3c71474366a3841dddccf7e50622b5ba3de141c (patch)
treec7e77e7f0fce742f75babace351c1669279e122f
parentMove EnsureDir() declaration up, ensure $MYVIM (diff)
downloaddotfiles-a3c71474366a3841dddccf7e50622b5ba3de141c.tar.gz
dotfiles-a3c71474366a3841dddccf7e50622b5ba3de141c.zip
Prepend $MYVIM to &runtimepath if not there
-rw-r--r--vim/vimrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 77d47ece..a4c9e5cb 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -121,6 +121,14 @@ if $MYVIM !=# ''
EnsureDir $MYVIM
endif
+" If the MYVIM environment variable was set outside Vim, it may not correspond
+" to the first element of the default &runtimepath. If this is the case,
+" we'll slot it in, having already checked it for troublesome characters.
+"
+if $MYVIM !=# s:SplitOption(&runtimepath)[0]
+ set runtimepath^=$MYVIM
+endif
+
" Create a 'vimrc' automatic command hook group, if it already exists, and
" clear away any automatic command hooks already defined within it if it does,
" so that we don't end up collecting multiple copies of the hooks configured