Merge pull request #84 from ccarral/master

Add basic italics support
This commit is contained in:
Tomáš Iser 2021-12-17 14:50:12 +01:00 committed by GitHub
commit 64bb3dcb14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -140,3 +140,12 @@ 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 in your `.vimrc` like so:
```
let g:codedark_italics = 1
colorscheme codedark
```
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', {})