aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-25 00:32:31 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-25 00:33:38 +1200
commit5f9e00100ea680153cf792aaf471d1bec17da6f9 (patch)
treee8a052971a2753a86c3fad278bbc712823ed10ea
parentSimplify 'encoding' checks (diff)
downloaddotfiles-5f9e00100ea680153cf792aaf471d1bec17da6f9.tar.gz
dotfiles-5f9e00100ea680153cf792aaf471d1bec17da6f9.zip
Switch to more robust $MYVIM definition
This should handle Neovim, too. It's not perfect, but if you have a comma in your home directory's name, I think you have bigger problems than a broken 'backupdir'...
-rw-r--r--vim/vimrc9
1 files changed, 3 insertions, 6 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 6bad90a6..3a6fd7b5 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,13 +1,10 @@
" Tom Ryder (tejr)'s vimrc: <https://sanctum.geek.nz/cgit/dotfiles.git>
" Requires Vim 7.0 or newer with +eval.
-" Set an environment variable for the user runtime directory
+" Set an environment variable for the user runtime directory, if not already
+" set; use the first element of &runtimepath, rather like 'spellfile'
if !exists('$MYVIM')
- let $MYVIM = expand(
- \ has('win32') || has('win64')
- \ ? '~/vimfiles'
- \ : '~/.vim'
- \ )
+ let $MYVIM = expand(split(&runtimepath, ',')[0])
endif
" The all-important default indent settings; filetypes to tweak