complete light/dark toggle

This commit is contained in:
Matthew Lyon
2014-01-21 16:26:01 -02:00
parent 126069fae7
commit 7e5e180992
3 changed files with 63 additions and 41 deletions

View File

@@ -16,7 +16,7 @@ does have a nice colorscheme, however.
## Requirements
May require a recent version of Vim.
Currently requires vim >= 7.0
## Installation
@@ -35,6 +35,14 @@ Just like any other colorscheme:
![vimscript-example](screenshots/vimscript-example.png)
There is a work-in-progress dark version, just set your background:
```vim
:set background=dark
```
![bash-example-dark](screenshots/bash-example-dark.png)
## Differences
Most notably, the # heading text is shaded blue. This is to compensate

View File

@@ -13,8 +13,10 @@ let g:colors_name='pencil'
" Colors
let s:black = { "gui": "#212121", "cterm": "0" }
let s:subtle_black = { "gui": "#303030", "cterm": "236" }
let s:light_black = { "gui": "#424242", "cterm": "8" }
let s:medium_grey = { "gui": "#808080", "cterm": "240" }
let s:lighter_black = { "gui": "#545454", "cterm": "240" }
let s:medium_grey = { "gui": "#767676", "cterm": "243" }
let s:light_grey = { "gui": "#D9D9D9", "cterm": "253" }
let s:lighter_grey = { "gui": "#E5E6E6", "cterm": "254" }
let s:white = { "gui": "#F1F1F1", "cterm": "15" }
@@ -24,15 +26,19 @@ let s:pink = { "gui": "#fb007a", "cterm": "9" }
let s:red = { "gui": "#C30771", "cterm": "1" }
let s:orange = { "gui": "#D75F5F", "cterm": "167" }
let s:darker_blue = { "gui": "#005F87", "cterm": "18" }
let s:dark_blue = { "gui": "#008EC4", "cterm": "4" }
let s:blue = { "gui": "#20BBFC", "cterm": "12" }
let s:light_blue = { "gui": "#b6d6fd", "cterm": "153" }
let s:dark_blue = { "gui": "#008EC4", "cterm": "4" }
let s:cyan = { "gui": "#20A5BA", "cterm": "6" }
let s:dark_cyan = { "gui": "#20A5BA", "cterm": "6" }
let s:light_cyan = { "gui": "#4FB8CC", "cterm": "14" }
let s:green = { "gui": "#10A778", "cterm": "2" }
let s:dark_green = { "gui": "#10A778", "cterm": "2" }
let s:light_green = { "gui": "#5FD7A7", "cterm": "10" }
let s:purple = { "gui": "#523C79", "cterm": "5" }
let s:dark_purple = { "gui": "#523C79", "cterm": "5" }
let s:light_purple = { "gui": "#6855DE", "cterm": "13" }
let s:yellow = { "gui": "#F3E430", "cterm": "11" }
let s:dark_yellow = { "gui": "#A89C14", "cterm": "3" }
@@ -67,12 +73,27 @@ let s:dark_yellow = { "gui": "#A89C14", "cterm": "3" }
if &background == "dark"
let s:bg = s:black
let s:bg_subtle = s:light_black
let s:bg_very_subtle = s:subtle_black
let s:norm = s:white
let s:norm_subtle = s:light_grey
let s:purple = s:light_purple
let s:cyan = s:light_cyan
let s:green = s:light_green
let s:visual = s:light_black
else
let s:bg = s:white
let s:bg_subtle = s:light_grey
let s:bg_very_subtle = s:lighter_grey
let s:norm = s:light_black
let s:norm_subtle = s:lighter_black
let s:purple = s:dark_purple
let s:cyan = s:dark_cyan
let s:green = s:dark_green
let s:visual = s:light_blue
endif
" shamelessly stolen from hemisu: https://github.com/noahfrederick/vim-hemisu/
function! s:h(group, style)
execute "highlight" a:group
\ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE")
@@ -91,7 +112,6 @@ call s:h("Normal", {"bg": s:bg, "fg": s:norm})
call s:h("Cursor", {"bg": s:blue, "fg": s:norm })
call s:h("Comment", {"fg": s:medium_grey, "gui": "italic"})
" yellow
call s:h("Constant", {"fg": s:green})
hi! link String Constant
hi! link Character Constant
@@ -99,11 +119,9 @@ hi! link Number Constant
hi! link Boolean Constant
hi! link Float Constant
" pink
call s:h("Identifier", {"fg": s:pink})
hi! link Function Identifier
" blue
call s:h("Statement", {"fg": s:dark_blue})
hi! link Conditonal Statement
hi! link Repeat Statement
@@ -112,20 +130,17 @@ hi! link Operator Statement
hi! link Keyword Statement
hi! link Exception Statement
" green
call s:h("PreProc", {"fg": s:cyan})
call s:h("PreProc", {"fg": s:purple})
hi! link Include PreProc
hi! link Include Define
hi! link Include Macro
hi! link Include PreCondit
hi! link Define PreProc
hi! link Macro PreProc
hi! link PreCondit PreProc
" purple
call s:h("Type", {"fg": s:purple})
call s:h("Type", {"fg": s:cyan})
hi! link StorageClass Type
hi! link Structure Type
hi! link Typedef Type
" red
call s:h("Special", {"fg": s:red})
hi! link Special Special
hi! link SpecialChar Special
@@ -146,19 +161,19 @@ call s:h("SpecialKey", {"fg": s:light_green})
call s:h("NonText", {"fg": s:medium_grey})
call s:h("Directory", {"fg": s:blue})
call s:h("ErrorMsg", {"fg": s:pink})
call s:h("IncSearch", {"bg": s:yellow, "fg": s:norm})
call s:h("Search", {"bg": s:yellow, "fg": s:norm})
call s:h("IncSearch", {"bg": s:yellow, "fg": s:light_black})
call s:h("Search", {"bg": s:yellow, "fg": s:light_black})
call s:h("MoreMsg", {"fg": s:medium_grey, "cterm": "bold", "gui": "bold"})
hi! link ModeMsg MoreMsg
call s:h("LineNr", {"fg": s:light_grey})
call s:h("CursorLineNr", {"fg": s:blue, "bg": s:lighter_grey})
call s:h("LineNr", {"fg": s:bg_subtle})
call s:h("CursorLineNr", {"fg": s:blue, "bg": s:bg_very_subtle})
call s:h("Question", {"fg": s:red})
call s:h("StatusLine", {"bg": s:light_grey})
call s:h("StatusLineNC", {"bg": s:light_grey, "fg": s:medium_grey})
call s:h("VertSplit", {"bg": s:light_grey, "fg": s:light_grey})
call s:h("StatusLine", {"bg": s:bg_subtle})
call s:h("StatusLineNC", {"bg": s:bg_subtle, "fg": s:medium_grey})
call s:h("VertSplit", {"bg": s:bg_subtle, "fg": s:bg_subtle})
call s:h("Title", {"fg": s:dark_blue})
call s:h("Visual", {"bg": s:light_blue})
call s:h("VisualNOS", {"bg": s:light_grey})
call s:h("Visual", {"bg": s:visual})
call s:h("VisualNOS", {"bg": s:bg_subtle})
call s:h("WarningMsg", {"fg": s:red})
call s:h("WildMenu", {"fg": s:bg, "bg": s:norm})
call s:h("Folded", {"fg": s:medium_grey})
@@ -169,26 +184,25 @@ call s:h("DiffChange", {"fg": s:dark_yellow})
call s:h("DiffText", {"fg": s:dark_blue})
call s:h("SignColumn", {"fg": s:light_green})
" hi Conceal
hi SpellBad guifg=fg guibg=bg gui=undercurl guisp=#cc0000 ctermfg=210 ctermbg=bg cterm=underline
hi SpellCap guifg=fg guibg=bg gui=undercurl guisp=#22cc22 ctermfg=174 ctermbg=bg cterm=underline
hi SpellRare guifg=fg guibg=bg gui=undercurl ctermfg=181 ctermbg=bg cterm=underline
hi SpellLocal guifg=fg guibg=bg gui=undercurl ctermfg=180 ctermbg=bg cterm=underline
call s:h("Pmenu", {"fg": s:norm, "bg": s:light_grey})
let s:spelling = "gui=undercurl cterm=underline guibg=NONE ctermbg=NONE "
exe "hi SpellBad " .s:spelling ."guisp=" .s:red.gui ." ctermfg=" .s:red.cterm
exe "hi SpellCap " .s:spelling ."guisp=" .s:light_green.gui ." ctermfg=" .s:light_green.cterm
exe "hi SpellRare " .s:spelling ."ctermfg=" .s:pink.cterm
exe "hi SpellLocal " .s:spelling ."ctermfg=" .s:dark_green.cterm
call s:h("Pmenu", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("PmenuSel", {"fg": s:norm, "bg": s:blue})
call s:h("PmenuSbar", {"fg": s:norm, "bg": s:light_grey})
call s:h("PmenuThumb", {"fg": s:norm, "bg": s:light_grey})
call s:h("TabLine", {"fg": s:norm, "bg": s:light_grey})
call s:h("PmenuSbar", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("PmenuThumb", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("TabLine", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("TabLineSel", {"fg": s:norm, "bg": s:blue})
call s:h("TabLineFill", {"fg": s:norm, "bg": s:light_grey})
call s:h("CursorColumn", {"bg": s:lighter_grey})
call s:h("CursorLine", {"bg": s:lighter_grey})
hi ColorColumn guifg=#5FD7AF guibg=#D9D9D9 ctermbg=79
call s:h("TabLineFill", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("CursorColumn", {"bg": s:bg_very_subtle})
call s:h("CursorLine", {"bg": s:bg_very_subtle})
call s:h("ColorColumn", {"fg": s:cyan, "bg": s:bg_subtle})
" remainder of syntax highlighting
hi MatchParen guifg=fg guibg=#F7DF94 ctermfg=16 ctermbg=72
hi vimFold guifg=#808080 ctermfg=244
hi vimCommentTitle guifg=fg ctermfg=fg
hi helpHyperTextJump guifg=#5FAFD7 ctermfg=74
hi htmlItalic guifg=fg guibg=NONE gui=italic ctermfg=38 ctermbg=NONE cterm=bold

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB