diff options
| author | 2017-09-28 15:24:53 +0200 | |
|---|---|---|
| committer | 2017-09-28 15:24:53 +0200 | |
| commit | 7bdc220cf6941f133c62c797612a0c96a9c6acd7 (patch) | |
| tree | b7306874376d9884ed474d650843bcb0d8efd730 /colors | |
| parent | 0992126892c8d98a150375327182d106bf609f09 (diff) | |
| download | nord-vim-7bdc220cf6941f133c62c797612a0c96a9c6acd7.tar.gz | |
Implement uniform diff background theme config
Added a theme configuration to let the users decide whether they want
to use colorful or uniform diff backgrounds.
The colorful diff is the default using the current colors for added,
changed and deleted elements and the default background color (nord0).
The "reverse" attribute gets applied which results in a colored
background and a dark foreground.
Setting the "g:nord_uniform_diff_background" variable to "1" enables
the uniform diff background using "nord1".
GH-60
Diffstat (limited to 'colors')
| -rwxr-xr-x | colors/nord.vim | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/colors/nord.vim b/colors/nord.vim index 9df083e..9779dc4 100755 --- a/colors/nord.vim +++ b/colors/nord.vim @@ -80,6 +80,10 @@ if !exists("g:nord_comment_brightness") let g:nord_comment_brightness = 0 endif +if !exists("g:nord_uniform_diff_background") + let g:nord_uniform_diff_background = 0 +endif + function! s:hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp) let l:attr = a:attr if g:nord_italic_comments == 0 && l:attr ==? 'italic' @@ -261,15 +265,17 @@ hi! link dtDelim Delimiter hi! link dtLocaleValue Keyword hi! link dtTypeValue Keyword -call s:hi("diffAdded", s:nord14_gui, "", s:nord14_term, "", "", "") -call s:hi("diffChanged", s:nord13_gui, "", s:nord13_term, "", "", "") -call s:hi("diffNewFile", s:nord8_gui, "", s:nord8_term, "", "", "") -call s:hi("diffOldFile", s:nord7_gui, "", s:nord7_term, "", "", "") -call s:hi("diffRemoved", s:nord11_gui, "", s:nord11_term, "", "", "") -call s:hi("DiffAdd", s:nord14_gui, "", s:nord14_term, "", "", "") -call s:hi("DiffChange", s:nord13_gui, "", s:nord13_term, "", "", "") -call s:hi("DiffDelete", s:nord11_gui, "", s:nord11_term, "", "", "") -call s:hi("DiffText", s:nord4_gui, "", "NONE", "", "", "") +if g:nord_uniform_diff_background == 0 + call s:hi("DiffAdd", s:nord14_gui, s:nord0_gui, s:nord14_term, "NONE", "inverse", "") + call s:hi("DiffChange", s:nord13_gui, s:nord0_gui, s:nord13_term, "NONE", "inverse", "") + call s:hi("DiffDelete", s:nord11_gui, s:nord0_gui, s:nord11_term, "NONE", "inverse", "") + call s:hi("DiffText", s:nord13_gui, s:nord0_gui, s:nord13_term, "NONE", "inverse", "") +else + call s:hi("DiffAdd", s:nord14_gui, s:nord1_gui, s:nord14_term, s:nord1_term, "", "") + call s:hi("DiffChange", s:nord13_gui, s:nord1_gui, s:nord13_term, s:nord1_term, "", "") + call s:hi("DiffDelete", s:nord11_gui, s:nord1_gui, s:nord11_term, s:nord1_term, "", "") + call s:hi("DiffText", s:nord13_gui, s:nord1_gui, s:nord13_term, s:nord1_term, "", "") +endif call s:hi("gitconfigVariable", s:nord7_gui, "", s:nord7_term, "", "", "") |