aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-27 22:20:04 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-27 22:20:04 +1200
commit318e2991a70b410ed9f93d811d7d0acebc75d424 (patch)
treebc4ebe14b50792cda27b34395cdc4c23251d1a5b
parent7211ee46fd9f1edd28ad182723e50ed1e1e03f19 (diff)
downloaddotfiles-318e2991a70b410ed9f93d811d7d0acebc75d424.tar.gz
Don't split entire array just to get first element
-rw-r--r--vim/vimrc4
1 files changed, 3 insertions, 1 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 44c1b33a..c88781c1 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -4,7 +4,9 @@
" 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(split(&runtimepath, ',')[0])
+ let $MYVIM = expand(
+ \ strpart(&runtimepath, 0, stridx(&runtimepath, ','))
+ \ )
endif
" The all-important default indent settings; filetypes to tweak