aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-14 14:46:20 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-14 14:46:20 +1200
commit78a8eaab453a4f1ad2cc39db9c4d1bb81f9ef9e3 (patch)
tree116699a86dde1e160ea7918e020be1367296b1dd
parentAdd links to plugin pages (diff)
downloaddotfiles-78a8eaab453a4f1ad2cc39db9c4d1bb81f9ef9e3.tar.gz
dotfiles-78a8eaab453a4f1ad2cc39db9c4d1bb81f9ef9e3.zip
Add detail on backslashed commas
-rw-r--r--vim/vimrc17
1 files changed, 11 insertions, 6 deletions
diff --git a/vim/vimrc b/vim/vimrc
index ba7ab63b..88ccd07f 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -83,19 +83,24 @@ scriptencoding utf-8
" , <- Literal comma
" [, ]* <- Any number of commas and spaces
"
-" We don't have to deal with escaped backslashes. You can read the source
-" code for the ad-hoc tokenizer in copy_option_part() in src/misc2.c in Vim's
-" source code and test it with some values of your own if you want to
-" understand why.
-"
" For the edge case of a blank 'runtimepath', MYVIM will be set to the empty
" string, due to the way that split() works by default without its third
" parameter {keepempty} set to false.
"
+" Once we have the path element, we have to remove the escaping for periods,
+" specifically remove up to one backslash before all periods. We don't,
+" however, have to deal with escaped backslashes, or any other character; you
+" can read the source code for the ad-hoc tokenizer in copy_option_part() in
+" src/misc2.c in Vim's source code and test it with some values of your own if
+" you want to understand why.
+"
" Vim, I love you, but you are really weird.
"
if !exists('$MYVIM')
- let $MYVIM = split(&runtimepath, '\\\@<!,[, ]*')[0]
+ let $MYVIM = substitute(
+ \ split(&runtimepath, '\\\@<!,[, ]*')[0],
+ \ '\\,', '', 'g'
+ \ )
endif
" Having either imported or defined a value for the MYVIM environment