mirror of
https://github.com/preservim/vim-colors-pencil.git
synced 2025-11-08 11:23:47 -05:00
Disable terminal italics by default, opt-in w/ var
Yes, terminal emulation is a ghetto. Why should that surprise you?
This commit is contained in:
@@ -64,6 +64,16 @@ If you’re looking for neutral heading colors, set the following in your
|
||||
let g:pencil_neutral_headings = 1 " 0=blue (def), 1=normal
|
||||
```
|
||||
|
||||
### Terminal Italics
|
||||
|
||||
If you're using Vim in the terminal and your terminal supports italics, you
|
||||
can opt-in to italic support for some syntax highlighting, such as comments,
|
||||
by setting the following in your `.vimrc`:
|
||||
|
||||
```
|
||||
let g:pencil_terminal_italics = 1
|
||||
```
|
||||
|
||||
### Airline Theme
|
||||
|
||||

|
||||
|
||||
@@ -45,6 +45,11 @@ if ! exists("g:pencil_neutral_headings")
|
||||
let g:pencil_neutral_headings = 0
|
||||
endif
|
||||
|
||||
" not all terminals support italics properly. If yours does, opt-in.
|
||||
if ! exists("g:pencil_terminal_italics")
|
||||
let g:pencil_terminal_italics = 0
|
||||
endif
|
||||
|
||||
" Colors
|
||||
let s:black = { "gui": "#212121", "cterm": "0" }
|
||||
let s:medium_gray = { "gui": "#767676", "cterm": "243" }
|
||||
@@ -122,6 +127,10 @@ endif
|
||||
|
||||
" shamelessly stolen from hemisu: https://github.com/noahfrederick/vim-hemisu/
|
||||
function! s:h(group, style)
|
||||
" Not all terminals support italics properly. If yours does, opt-in.
|
||||
if g:pencil_terminal_italics == 0 && has_key(a:style, "cterm") && a:style["cterm"] == "italic"
|
||||
unlet a:style.cterm
|
||||
endif
|
||||
execute "highlight" a:group
|
||||
\ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE")
|
||||
\ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE")
|
||||
|
||||
Reference in New Issue
Block a user