aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-19 00:35:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-19 00:35:37 +1200
commit17c9a8344a67411d4ec7cf469eea989b145cc446 (patch)
treef3623f6510661be0c73dcd2867bf25a8a4d65e0b /vim/vimrc
parentJoin conditionals (diff)
downloaddotfiles-17c9a8344a67411d4ec7cf469eea989b145cc446.tar.gz
dotfiles-17c9a8344a67411d4ec7cf469eea989b145cc446.zip
Correct ColorScheme event handling for old Vim
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc11
1 files changed, 8 insertions, 3 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 9ec1eea1..2f638b6b 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1053,10 +1053,15 @@ endif
" background. For any other color scheme, turn the option off, because it
" almost always stands out too much for my liking.
"
+" You'd think the autocommand pattern here could be used to match the colour
+" scheme name, and it can be...after patch v7.4.108, when Christian Brabandt
+" fixed it. Until that version, it matched against the current buffer name,
+" so we're forced to have an explicit test in the command instead.
+"
+" <https://github.com/vim/vim/releases/tag/v7.4.108>
+"
autocmd vimrc ColorScheme *
- \ set nocursorline
-autocmd vimrc ColorScheme sahara
- \ set cursorline
+ \ let &cursorline = g:colors_name ==# 'sahara'
" Use 'dark' as my default value for 'background', in the absence of an
" environment variable COLORFGBG or a response in v:termrbgresp that would set