diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 00:32:31 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 00:33:38 +1200 |
commit | 5f9e00100ea680153cf792aaf471d1bec17da6f9 (patch) | |
tree | e8a052971a2753a86c3fad278bbc712823ed10ea | |
parent | Simplify 'encoding' checks (diff) | |
download | dotfiles-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/vimrc | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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 |