From 5f9e00100ea680153cf792aaf471d1bec17da6f9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 00:32:31 +1200 Subject: 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'... --- vim/vimrc | 9 +++------ 1 file 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: " 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 -- cgit v1.2.3