vim-monochrome

My fork of github.com/fxn/vim-monochrome
git clone https://git.sr.ht/~jbauer/vim-monochrome
Log | Files | Refs | README | LICENSE

commit 906eb7abb761845224963c427b129eb8a726f3e3
parent cb8ca671601564deade031ef09265828cbed9049
Author: Xavier Noria <fxn@hashref.com>
Date:   Fri, 27 Oct 2017 11:08:48 +0200

line under cursor preserves style

Diffstat:
Mcolors/monochrome.vim | 27+++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/colors/monochrome.vim b/colors/monochrome.vim @@ -30,6 +30,8 @@ let s:bold = 'bold' let s:underline = 'underline' let s:none = 'NONE' +let s:default = [] + if !exists("g:monochrome_italic_comments") let g:monochrome_italic_comments = 0 endif @@ -42,13 +44,22 @@ function! s:hi(...) let attr = get(a:, 4, s:none) let cmd = ['hi', group] - call add(cmd, 'guifg='.fg[0]) - call add(cmd, 'guibg='.bg[0]) - call add(cmd, 'gui='.attr) - call add(cmd, 'ctermfg='.fg[1]) - call add(cmd, 'ctermbg='.bg[1]) - call add(cmd, 'cterm='.attr) - call add(cmd, 'term='.attr) + + if fg != s:default + call add(cmd, 'guifg='.fg[0]) + call add(cmd, 'ctermfg='.fg[1]) + endif + + if bg != s:default + call add(cmd, 'guibg='.bg[0]) + call add(cmd, 'ctermbg='.bg[1]) + endif + + if attr != s:default + call add(cmd, 'gui='.attr) + call add(cmd, 'cterm='.attr) + call add(cmd, 'term='.attr) + endif exec join(cmd, ' ') endfunction @@ -58,7 +69,7 @@ call s:hi('Normal') call s:hi('Cursor', s:black, s:lgray) " Cursor line. -call s:hi('CursorLine', s:default_fg, s:bgray) +call s:hi('CursorLine', s:default, s:bgray, s:default) call s:hi('CursorLineNr', s:white, s:default_bg, s:bold) " Color column.