From 318e2991a70b410ed9f93d811d7d0acebc75d424 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 27 May 2019 22:20:04 +1200 Subject: Don't split entire array just to get first element --- vim/vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3