Add italics support for Comment and SpecialComment highlight groups and

update README.md
This commit is contained in:
Carlos Carral C 2021-09-14 10:29:08 -05:00
commit 0872dc8a8b
2 changed files with 11 additions and 2 deletions

View file

@ -140,3 +140,7 @@ set guifont=Powerline_Consolas:h11
set renderoptions=type:directx,gamma:1.5,contrast:0.5,geom:1,renmode:5,taamode:1,level:0.5 set renderoptions=type:directx,gamma:1.5,contrast:0.5,geom:1,renmode:5,taamode:1,level:0.5
``` ```
### Are italics supported?
Italics in comments can be enabled by setting `g:codedark_italics = 1` before
setting the colorscheme. Please note that your terminal must support rendering italic fonts.

View file

@ -107,6 +107,11 @@ if !exists("g:codedark_conservative")
let g:codedark_conservative=0 let g:codedark_conservative=0
endif endif
" Italicized comments
if !exists("g:codedark_italics")
let g:codedark_italics=0
endif
let s:cdGray = {'gui': '#808080', 'cterm': s:cterm04, 'cterm256': '08'} let s:cdGray = {'gui': '#808080', 'cterm': s:cterm04, 'cterm256': '08'}
let s:cdViolet = {'gui': '#646695', 'cterm': s:cterm04, 'cterm256': '60'} let s:cdViolet = {'gui': '#646695', 'cterm': s:cterm04, 'cterm256': '60'}
let s:cdBlue = {'gui': '#569CD6', 'cterm': s:cterm0D, 'cterm256': '75'} let s:cdBlue = {'gui': '#569CD6', 'cterm': s:cterm0D, 'cterm256': '75'}
@ -174,7 +179,7 @@ hi! link diffAdded DiffAdd
hi! link diffChanged DiffChange hi! link diffChanged DiffChange
hi! link diffRemoved DiffDelete hi! link diffRemoved DiffDelete
call <sid>hi('Comment', s:cdGreen, {}, 'none', {}) if g:codedark_italics | call <sid>hi('Comment', s:cdGreen, {}, 'italic', {}) | else | call <sid>hi('Comment', s:cdGreen, {}, 'none', {}) | endif
call <sid>hi('Constant', s:cdBlue, {}, 'none', {}) call <sid>hi('Constant', s:cdBlue, {}, 'none', {})
call <sid>hi('String', s:cdOrange, {}, 'none', {}) call <sid>hi('String', s:cdOrange, {}, 'none', {})
@ -209,7 +214,7 @@ call <sid>hi('Special', s:cdYellowOrange, {}, 'none', {})
call <sid>hi('SpecialChar', s:cdFront, {}, 'none', {}) call <sid>hi('SpecialChar', s:cdFront, {}, 'none', {})
call <sid>hi('Tag', s:cdFront, {}, 'none', {}) call <sid>hi('Tag', s:cdFront, {}, 'none', {})
call <sid>hi('Delimiter', s:cdFront, {}, 'none', {}) call <sid>hi('Delimiter', s:cdFront, {}, 'none', {})
call <sid>hi('SpecialComment', s:cdGreen, {}, 'none', {}) if g:codedark_italics | call <sid>hi('SpecialComment', s:cdGreen, {}, 'italic', {}) | else | call <sid>hi('SpecialComment', s:cdGreen, {}, 'none', {}) | endif
call <sid>hi('Debug', s:cdFront, {}, 'none', {}) call <sid>hi('Debug', s:cdFront, {}, 'none', {})
call <sid>hi('Underlined', s:cdNone, {}, 'underline', {}) call <sid>hi('Underlined', s:cdNone, {}, 'underline', {})