aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-09 15:30:47 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-09 15:30:47 +1200
commit54960d194a30514780ca9bdcab824060db03288c (patch)
tree4c84e39a9b4b84c8817b098ed5f50c347145c565 /vim
parentRefactor directory creation with custom command (diff)
downloaddotfiles-54960d194a30514780ca9bdcab824060db03288c.tar.gz
dotfiles-54960d194a30514780ca9bdcab824060db03288c.zip
Refactor 'runtimepath' split back into function
Still not sure about this part.
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc17
1 files changed, 11 insertions, 6 deletions
diff --git a/vim/vimrc b/vim/vimrc
index eb038bed..39d6ec8a 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -43,11 +43,16 @@
" We don't have to deal with escaped backslashes; read the source of
" copy_option_part() in vim/src/misc2.c to see why.
"
-let s:option_split_pattern
- \ = '\\'
- \ . '\@<!'
- \ . ','
- \ . '[, ]*'
+function! s:SplitOption(string) abort
+ let string = a:string
+ let pattern
+ \ = '\\'
+ \ . '\@<!'
+ \ . ','
+ \ . '[, ]*'
+ let parts = split(string, pattern)
+ return parts
+endfunction
" With 'runtimepath' cleaned up, the next thing we'll do is set an environment
" variable MYVIM for the user runtime directory, if such a variable does not
@@ -66,7 +71,7 @@ let s:option_split_pattern
" database files in the absence of a setting for 'spellfile'.
"
if !exists('$MYVIM') && &runtimepath !=# ''
- let $MYVIM = split(&runtimepath, s:option_split_pattern)[0]
+ let $MYVIM = s:SplitOption(&runtimepath)[0]
endif
" We need to check the MYVIM environment variable's value to ensure it's not