aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-27 08:52:53 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-07-01 09:43:38 +1200
commit55e0b6d4cb731fd9e4a4ef058c373374794a9ee1 (patch)
treeb4db55083f532de529f22064e2fc2071ab6d2884 /vim/vimrc
parentStripped all comments, refactored directories (diff)
downloaddotfiles-55e0b6d4cb731fd9e4a4ef058c373374794a9ee1.tar.gz
dotfiles-55e0b6d4cb731fd9e4a4ef058c373374794a9ee1.zip
Factor out option split into a function
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc16
1 files changed, 9 insertions, 7 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 0e202b70..1d551835 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -2,15 +2,17 @@ if !exists('$LANG') && &encoding ==# 'latin1'
set encoding=utf-8
endif
scriptencoding utf-8
-if exists('$MYVIM')
- execute 'set runtimepath^='.escape(escape(
- \ $MYVIM,
- \ ','), '\ %#|"')
-else
- let $MYVIM = map(
+function! s:OptionSplit(string) abort
+ return map(
\ split(&runtimepath, '\\\@<!,[, ]*'),
\ 'substitute(v:val, ''\\,'', '','', ''g'')',
- \)[0]
+ \)
+endfunction
+if exists('$MYVIM')
+ execute 'set runtimepath^='.s:EscItemExec($MYVIM)
+else
+ let s:runtimepath = s:OptionSplit(&runtimepath)
+ let $MYVIM = s:runtimepath[0]
endif
let s:cache = $MYVIM.'/cache'
if !isdirectory(s:cache)