Implement comment brightness configuration feature

GH-48
This commit is contained in:
Sheldon Johnson 2017-09-23 19:32:43 +10:00 committed by Arctic Ice Studio
parent 063620f027
commit e18ab4e893
2 changed files with 50 additions and 4 deletions

View file

@ -20,6 +20,7 @@ Nord Vim is a 16 colorspace theme build to run in GUI- and terminal mode with su
- [Activation](#activation)
- [Configuration](#configuration)
- [Italic comments](#italic-comments)
- [Comment contrast](#comment-contrast)
- [Plugin Support](#plugin-support)
- [UI Plugins](#ui-plugins)
- [Language Plugins](#language-plugins)
@ -109,11 +110,28 @@ All options should be set **before** the [activation](#activation) command!
Enable to use italic font for all comments.
To adhere to the Nord style guide this option is disabled by default.
It can be enabled by setting the `g:nord_italic_comments` variable to `1`.
It can be enabled by setting the `g:nord_italic_comments` variable to `1`.
```vim
let g:nord_italic_comments = 1
```
### Comment contrast
**This option should only be enabled if your terminal emulator supports 24bit true color (16 million colors)!**
This option is only visible if `termguicolors` is enabled in your `~/.vimrc` or set via `:set termguicolors`!
The comment brightness can be increased by 1 - 20 percent. It can be enabled by setting the `g:nord_comment_brightness`
variable to a number between `1` and `20`.
```vim
let g:nord_comment_brightness = 12
```
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].
## Plugin Support
Nord Vim provides support for many third-party language- and the UI plugins.
@ -159,9 +177,9 @@ Please report issues/bugs, feature requests and suggestions for improvements to
<p align="center"><a href="http://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-5E81AC.svg?style=flat-square"/></a> <a href="https://creativecommons.org/licenses/by-sa/4.0"><img src="https://img.shields.io/badge/License-CC_BY--SA_4.0-5E81AC.svg?style=flat-square"/></a></p>
[gist-true-color]: https://gist.github.com/XVilka/8346728
[scrot-readme-default-profile]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/src/assets/scrot-readme-default-profile.png
[scrot-readme-lazy-profile-change]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/src/assets/scrot-readme-lazy-profile-change.png
[scrot-lang-c]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-c.png
[scrot-lang-css]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-css.png
[scrot-lang-html]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-html.png

View file

@ -48,10 +48,38 @@ let s:nord13_term = "3"
let s:nord14_term = "2"
let s:nord15_term = "5"
if !exists('g:nord_italic_comments')
let s:nord3_gui_brightened = [
\ s:nord3_gui,
\ "#4e586d",
\ "#505b70",
\ "#525d73",
\ "#556076",
\ "#576279",
\ "#59647c",
\ "#5b677f",
\ "#5d6982",
\ "#5f6c85",
\ "#616e88",
\ "#63718b",
\ "#66738e",
\ "#687591",
\ "#6a7894",
\ "#6d7a96",
\ "#6f7d98",
\ "#72809a",
\ "#75829c",
\ "#78859e",
\ "#7b88a1",
\ ]
if !exists("g:nord_italic_comments")
let g:nord_italic_comments = 0
endif
if !exists("g:nord_comment_brightness")
let g:nord_comment_brightness = 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'
@ -150,7 +178,7 @@ call s:hi("VertSplit", s:nord2_gui, s:nord1_gui, s:nord3_term, s:nord1_term, "NO
"+----------------------+
call s:hi("Boolean", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Character", s:nord14_gui, "", s:nord14_term, "", "", "")
call s:hi("Comment", s:nord3_gui, "", s:nord3_term, "", "italic", "")
call s:hi("Comment", s:nord3_gui_brightened[g:nord_comment_brightness], "", s:nord3_term, "", "italic", "")
call s:hi("Conditional", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Constant", s:nord4_gui, "", "NONE", "", "", "")
call s:hi("Define", s:nord9_gui, "", s:nord9_term, "", "", "")