Merge pull request #89 from arcticicestudio/feature/gh-88-configuration-for-italics

Configuration for italic
This commit is contained in:
Arctic Ice Studio 2017-12-30 09:52:33 +01:00 committed by GitHub
commit dbfc55ff14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 24 deletions

View file

@ -19,10 +19,11 @@ Nord Vim is a 16 colorspace theme build to run in GUI- and terminal mode with su
- [Manual](#manual) - [Manual](#manual)
- [Activation](#activation) - [Activation](#activation)
- [Configuration](#configuration) - [Configuration](#configuration)
- [Italic comments](#italic-comments) - [Italic Support](#italic)
- [Uniform status lines](#uniform-status-lines) - [Italic Comments](#italic-comments)
- [Comment contrast](#comment-contrast) - [Uniform Status Lines](#uniform-status-lines)
- [Uniform diff background](#uniform-diff-background) - [Comment Contrast](#comment-contrast)
- [Uniform diff Background](#uniform-diff-background)
- [Plugin Support](#plugin-support) - [Plugin Support](#plugin-support)
- [UI Plugins](#ui-plugins) - [UI Plugins](#ui-plugins)
- [Language Plugins](#language-plugins) - [Language Plugins](#language-plugins)
@ -104,12 +105,28 @@ Plug 'arcticicestudio/nord-vim', { 'on': 'NERDTreeToggle' }
``` ```
## Configuration ## Configuration
All options should be set **before** the [activation](#activation) command! All options should be set **before** the [activation](#activation) command!
### Italic comments ### Italic Support
**This option should only be enabled if your terminal emulator supports italics!** **This option should only be enabled if your terminal emulator supports italics!**
Enable to use italic font for all comments. Enables support for italic text.
Most terminals don't handle italics right so Nord disables italics for terminals by default while in GUI mode this option is enabled by default.
Italics for terminals can be enabled by setting the `g:nord_italic` to `1` to enforce displaying italics.
```vim
let g:nord_italic = 1
```
### Italic Comments
**This option only takes effect if the option for [italic text support](#italic-support) has been enabled!**
Enable to italicize all comments.
To adhere to the Nord style guide this option is disabled by default. 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`.
@ -118,7 +135,9 @@ It can be enabled by setting the `g:nord_italic_comments` variable to `1`.
let g:nord_italic_comments = 1 let g:nord_italic_comments = 1
``` ```
### Uniform status lines ![][scrot-config-italic-comments]
### Uniform Status Lines
Enables uniform activate- and inactive status lines using `nord3` as background. Enables uniform activate- and inactive status lines using `nord3` as background.
@ -132,7 +151,8 @@ let g:nord_uniform_status_lines = 1
<align="center"><strong>Default status lines</strong><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-config-uniform-status-lines-default.png"/><br><strong>Uniform status lines</strong><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-config-uniform-status-lines.png"/></p> <align="center"><strong>Default status lines</strong><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-config-uniform-status-lines-default.png"/><br><strong>Uniform status lines</strong><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-config-uniform-status-lines.png"/></p>
### Comment contrast ### Comment Contrast
**This option should only be enabled if your terminal emulator supports 24bit true color (16 million colors)!** **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`! This option is only visible if `termguicolors` is enabled in your `~/.vimrc` or set via `:set termguicolors`!
@ -148,7 +168,8 @@ 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]. More information about true color and the support in various terminals can be found in [this gist][gist-true-color].
### Uniform diff background ### Uniform `diff` Background
By default, Nord Vim provides colorful backgrounds when used in *diff* mode `vimdiff`/`vim -d`. 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`. This can be changed to `nord1` as uniform *diff* background color by setting the `g:nord_uniform_diff_background` variable to `1`.
@ -206,8 +227,7 @@ Please report issues/bugs, feature requests and suggestions for improvements to
<p align="center"><a href="https://github.com/arcticicestudio/nord-vim/blob/develop/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-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> <p align="center"><a href="https://github.com/arcticicestudio/nord-vim/blob/develop/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-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 [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-config-italic-comments]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-config-italic-comments.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-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-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 [scrot-lang-html]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-html.png
@ -218,3 +238,5 @@ Please report issues/bugs, feature requests and suggestions for improvements to
[scrot-lang-php]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-php.png [scrot-lang-php]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-php.png
[scrot-lang-python]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-python.png [scrot-lang-python]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-python.png
[scrot-lang-ruby]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-ruby.png [scrot-lang-ruby]: https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/assets/scrot-lang-ruby.png
[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

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View file

@ -71,8 +71,24 @@ let s:nord3_gui_brightened = [
\ "#7b88a1", \ "#7b88a1",
\ ] \ ]
if !exists("g:nord_italic_comments") if !exists("g:nord_italic")
let g:nord_italic_comments = 0 if has("gui_running") || $TERM_ITALICS == "true"
let g:nord_italic=1
else
let g:nord_italic=0
endif
endif
let s:italic = "italic,"
if g:nord_italic == 0
let s:italic = ""
endif
let s:italicize_comments = ""
if exists("g:nord_italic_comments")
if g:nord_italic_comments == 1
let s:italicize_comments = s:italic
endif
endif endif
if !exists('g:nord_uniform_status_lines') if !exists('g:nord_uniform_status_lines')
@ -88,11 +104,6 @@ if !exists("g:nord_uniform_diff_background")
endif endif
function! s:hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp) function! s:hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
let l:attr = a:attr
if g:nord_italic_comments == 0 && l:attr ==? 'italic'
let l:attr= 'NONE'
endif
if a:guifg != "" if a:guifg != ""
exec "hi " . a:group . " guifg=" . a:guifg exec "hi " . a:group . " guifg=" . a:guifg
endif endif
@ -106,7 +117,7 @@ function! s:hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
exec "hi " . a:group . " ctermbg=" . a:ctermbg exec "hi " . a:group . " ctermbg=" . a:ctermbg
endif endif
if a:attr != "" if a:attr != ""
exec "hi " . a:group . " gui=" . l:attr . " cterm=" . l:attr exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
endif endif
if a:guisp != "" if a:guisp != ""
exec "hi " . a:group . " guisp=" . a:guisp exec "hi " . a:group . " guisp=" . a:guisp
@ -118,7 +129,7 @@ endfunction
"+---------------+ "+---------------+
"+--- Attributes ---+ "+--- Attributes ---+
call s:hi("Bold", "", "", "", "", "bold", "") call s:hi("Bold", "", "", "", "", "bold", "")
call s:hi("Italic", "", "", "", "", "italic", "") call s:hi("Italic", "", "", "", "", s:italic, "")
call s:hi("Underline", "", "", "", "", "underline", "") call s:hi("Underline", "", "", "", "", "underline", "")
"+--- Editor ---+ "+--- Editor ---+
@ -211,7 +222,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("Boolean", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Character", s:nord14_gui, "", s:nord14_term, "", "", "") call s:hi("Character", s:nord14_gui, "", s:nord14_term, "", "", "")
call s:hi("Comment", s:nord3_gui_brightened[g:nord_comment_brightness], "", s:nord3_term, "", "italic", "") call s:hi("Comment", s:nord3_gui_brightened[g:nord_comment_brightness], "", s:nord3_term, "", s:italicize_comments, "")
call s:hi("Conditional", s:nord9_gui, "", s:nord9_term, "", "", "") call s:hi("Conditional", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Constant", s:nord4_gui, "", "NONE", "", "", "") call s:hi("Constant", s:nord4_gui, "", "NONE", "", "", "")
call s:hi("Define", s:nord9_gui, "", s:nord9_term, "", "", "") call s:hi("Define", s:nord9_gui, "", s:nord9_term, "", "", "")
@ -229,7 +240,7 @@ call s:hi("PreProc", s:nord9_gui, "", s:nord9_term, "", "NONE", "")
call s:hi("Repeat", s:nord9_gui, "", s:nord9_term, "", "", "") call s:hi("Repeat", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Special", s:nord4_gui, "", "NONE", "", "", "") call s:hi("Special", s:nord4_gui, "", "NONE", "", "", "")
call s:hi("SpecialChar", s:nord13_gui, "", s:nord13_term, "", "", "") call s:hi("SpecialChar", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("SpecialComment", s:nord8_gui, "", s:nord8_term, "", "italic", "") call s:hi("SpecialComment", s:nord8_gui, "", s:nord8_term, "", s:italicize_comments, "")
call s:hi("Statement", s:nord9_gui, "", s:nord9_term, "", "", "") call s:hi("Statement", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("StorageClass", s:nord9_gui, "", s:nord9_term, "", "", "") call s:hi("StorageClass", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("String", s:nord14_gui, "", s:nord14_term, "", "", "") call s:hi("String", s:nord14_gui, "", s:nord14_term, "", "", "")
@ -488,7 +499,7 @@ call s:hi("plugDeleted", s:nord11_gui, "", "", s:nord11_term, "", "")
"+--- Languages ---+ "+--- Languages ---+
" JavaScript " JavaScript
" > pangloss/vim-javascript " > pangloss/vim-javascript
call s:hi("jsGlobalNodeObjects", s:nord8_gui, "", s:nord8_term, "", "italic", "") call s:hi("jsGlobalNodeObjects", s:nord8_gui, "", s:nord8_term, "", s:italic, "")
hi! link jsBrackets Delimiter hi! link jsBrackets Delimiter
hi! link jsFuncCall Function hi! link jsFuncCall Function
hi! link jsFuncParens Delimiter hi! link jsFuncParens Delimiter
@ -514,7 +525,7 @@ hi! link mkdFootnotes mkdFootnote
hi! link mkdLink markdownLinkText hi! link mkdLink markdownLinkText
hi! link mkdURL markdownUrl hi! link mkdURL markdownUrl
hi! link mkdInlineURL mkdURL hi! link mkdInlineURL mkdURL
hi! link mkdID Identifier "CHECK hi! link mkdID Identifier
hi! link mkdLinkDef mkdLink hi! link mkdLinkDef mkdLink
hi! link mkdLinkDefTarget mkdURL hi! link mkdLinkDefTarget mkdURL
hi! link mkdLinkTitle mkdInlineURL hi! link mkdLinkTitle mkdInlineURL