From 17c9a8344a67411d4ec7cf469eea989b145cc446 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 19 Jun 2019 00:35:37 +1200 Subject: Correct ColorScheme event handling for old Vim --- vim/vimrc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vim/vimrc') 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. +" +" +" 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 -- cgit v1.2.3