Skip to content

Commit

Permalink
Merge pull request #61 from arcticicestudio/feature/gh-60-uniform-dif…
Browse files Browse the repository at this point in the history
…f-background-config

Uniform diff background theme configuration
  • Loading branch information
arcticicestudio authored Sep 28, 2017
2 parents e532b5d + 7bdc220 commit 958322d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Nord Vim is a 16 colorspace theme build to run in GUI- and terminal mode with su
- [Configuration](#configuration)
- [Italic comments](#italic-comments)
- [Comment contrast](#comment-contrast)
- [Uniform diff background](#uniform-diff-background)
- [Plugin Support](#plugin-support)
- [UI Plugins](#ui-plugins)
- [Language Plugins](#language-plugins)
Expand Down Expand Up @@ -132,8 +133,20 @@ To adhere to the Nord style guide this option uses `nord3` by default.

More information about true color and the support in various terminals can be found in [this gist][gist-true-color].

### Uniform diff background
By default, Nord Vim provides colorful backgrounds when used in *diff* mode `vimdiff`/`vim -d`.

This can be changed to `nord1` as uniform *diff* background color by setting the `g:nord_uniform_diff_background` variable to `1`.

```vim
let g:nord_uniform_diff_background = 1
```

<align="center"><strong>Colorful backgrounds (default)</strong><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-config-uniform-diff-default.png"/><br><strong>Uniform diff background</strong><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-config-uniform-diff-default.png"/>
</p>

## Plugin Support
Nord Vim provides support for many third-party language- and the UI plugins.
Nord Vim provides support for many third-party language- and UI plugins.

### UI Plugins
<p align="center"><a href="https://github.com/itchyny/lightline.vim">lightline</a><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-plugin-support-ui-lightline.png"/><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-plugin-support-ui-lightline-vsplit.png"/></p>
Expand Down
Binary file added assets/scrot-config-uniform-diff-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/scrot-config-uniform-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 15 additions & 9 deletions colors/nord.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -262,15 +266,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, "", "", "")

Expand Down

0 comments on commit 958322d

Please sign in to comment.