commit 5319abcee7156db63a0900a73d2af282a5747f90
parent 21e4cd7b73f4b9e2efc8e57987544a8e6ff61d3f
Author: Xavier Noria <fxn@hashref.com>
Date: Thu, 26 Oct 2017 22:08:13 +0200
defines a flag to configure comments in italics
Diffstat:
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
@@ -16,9 +16,15 @@ to your init file.
This color scheme works in GUIs and 256 color terminals, throw this to your
_~/.vimrc_:
- syntax on
colorscheme monochrome
+Comments can optionally be rendered using italics:
+
+ let g:monochrome_italic_comments = 1
+ colorscheme monochrome
+
+It is important that the flag is set before loading the theme.
+
### Screenshots
#### Ruby
diff --git a/colors/monochrome.vim b/colors/monochrome.vim
@@ -30,6 +30,11 @@ let s:bold = 'bold'
let s:underline = 'underline'
let s:none = 'NONE'
+if !exists("g:monochrome_italic_comments")
+ let g:monochrome_italic_comments = 0
+endif
+let s:comment_attr = g:monochrome_italic_comments ? s:italic : s:none
+
function! s:hi(...)
let group = a:1
let fg = get(a:, 2, s:default_fg)
@@ -70,7 +75,7 @@ call s:hi('LineNr', s:dgray)
call s:hi('Statement', s:white, s:default_bg, s:bold)
call s:hi('PreProc', s:white, s:default_bg, s:bold)
call s:hi('String', s:sblue)
-call s:hi('Comment', s:cgray)
+call s:hi('Comment', s:cgray, s:default_bg, s:comment_attr)
call s:hi('Constant')
call s:hi('Type', s:white, s:default_bg, s:bold)
call s:hi('Function', s:white)