vim-monochrome

My fork of github.com/fxn/vim-monochrome
git clone https://git.sr.ht/~jbauer/vim-monochrome
Log | Files | Refs | README | LICENSE

monochrome-light.vim (6955B)


      1 " monochrome.vim
      2 "
      3 " Original Author: Xavier Noria <fxn@hashref.com>
      4 "         License: MIT
      5 "     Modified By: Jake Bauer <jbauer@paritybit.ca>
      6 
      7 set background=light
      8 
      9 hi clear
     10 if exists('syntax_on')
     11 	syntax reset
     12 endif
     13 
     14 let g:colors_name = 'monochrome-light'
     15 
     16 let s:black      = ['#000000', 16]
     17 let s:red        = ['#870000', 88]
     18 let s:green      = ['#008700', 28]
     19 let s:blue       = ['#005FAF', 25]
     20 let s:yellow     = ['#AF8700', 136]
     21 let s:white      = ['#EEEEEE', 255]
     22 let s:accent     = ['#6C6C6C', 242]
     23 let s:cursorline = ['#DADADA', 253]
     24 let s:comment    = ['#585858', 240]
     25 let s:faded      = ['#D0D0D0', 252]
     26 let s:menu       = ['#BCBCBC', 250]
     27 let s:menusel    = ['#9E9E9E', 247]
     28 
     29 let s:default_fg = s:black
     30 let s:default_bg = s:white
     31 
     32 let s:italic    = 'italic'
     33 let s:bold      = 'bold'
     34 let s:underline = 'underline'
     35 let s:none      = 'NONE'
     36 
     37 let s:default_lst = []
     38 let s:default_str = ''
     39 
     40 let s:comment_attr = s:italic
     41 
     42 function! s:hi(...)
     43 	let group = a:1
     44 	let fg    = get(a:, 2, s:default_fg)
     45 	let bg    = get(a:, 3, s:default_bg)
     46 	let attr  = get(a:, 4, s:default_str)
     47 
     48 	let cmd = ['hi', group]
     49 
     50 	if fg != s:default_lst
     51 		call add(cmd, 'guifg='.fg[0])
     52 		call add(cmd, 'ctermfg='.fg[1])
     53 	endif
     54 
     55 	if bg != s:default_lst
     56 		call add(cmd, 'guibg='.bg[0])
     57 		call add(cmd, 'ctermbg='.bg[1])
     58 	endif
     59 
     60 	if attr != s:default_str
     61 		call add(cmd, 'gui='.attr)
     62 		call add(cmd, 'cterm='.attr)
     63 	endif
     64 
     65 	exec "hi clear " group
     66 	exec join(cmd, ' ')
     67 endfunction
     68 
     69 
     70 " --- Vim interface ------------------------------------------------------------
     71 call s:hi('Normal', s:black, s:white, s:none)
     72 call s:hi('Cursor', s:white, s:black)
     73 call s:hi('CursorLine', s:black, s:cursorline, s:none)
     74 call s:hi('CursorLineNr', s:black, s:default_bg, s:bold)
     75 call s:hi('ColorColumn', s:black, s:faded)
     76 call s:hi('Search', s:black, s:faded)
     77 call s:hi('Visual', s:black, s:faded)
     78 call s:hi('ErrorMsg', s:red, s:default_bg)
     79 
     80 " Status bar
     81 call s:hi('StatusLine', s:black, s:faded)
     82 call s:hi('StatusLineNC', s:black, s:faded)
     83 
     84 " Tildes at the bottom of a buffer, etc.
     85 call s:hi('NonText', s:accent)
     86 
     87 " Folding.
     88 call s:hi('FoldColumn', s:faded)
     89 call s:hi('Folded')
     90 
     91 " Line numbers gutter.
     92 call s:hi('LineNr', s:black, s:faded)
     93 
     94 " Small arrow used for tabs.
     95 call s:hi('SpecialKey', s:accent, s:default_bg, s:bold)
     96 
     97 " File browsers.
     98 call s:hi('Directory', s:black, s:default_bg, s:bold)
     99 
    100 " Help.
    101 call s:hi('helpSpecial')
    102 call s:hi('helpHyperTextJump', s:accent, s:default_bg, s:underline)
    103 call s:hi('helpNote')
    104 
    105 " Popup menu.
    106 call s:hi('Pmenu', s:black, s:menu)
    107 call s:hi('PmenuSel', s:black, s:menusel)
    108 
    109 " Notes.
    110 call s:hi('Todo', s:black, s:default_bg, s:bold)
    111 
    112 " Signs.
    113 call s:hi('SignColumn')
    114 
    115 " --- Diff Mode ----------------------------------------------------------------
    116 call s:hi('DiffAdd', s:green, s:default_bg)
    117 call s:hi('DiffDelete', s:red, s:default_bg)
    118 call s:hi('DiffChange', s:black, s:default_bg)
    119 call s:hi('DiffText', s:yellow, s:default_bg)
    120 
    121 " --- Programming languages ----------------------------------------------------
    122 call s:hi('Statement', s:black, s:default_bg, s:bold)
    123 call s:hi('PreProc', s:black, s:default_bg, s:bold)
    124 call s:hi('String', s:accent)
    125 call s:hi('Comment', s:comment, s:default_bg, s:comment_attr)
    126 call s:hi('Constant', s:black, s:default_bg, s:bold)
    127 call s:hi('Number', s:accent)
    128 call s:hi('Type', s:black, s:default_bg, s:bold)
    129 call s:hi('Function', s:black)
    130 call s:hi('Identifier', s:default_fg, s:default_bg, s:none)
    131 call s:hi('Special')
    132 call s:hi('MatchParen', s:black, s:faded, s:underline)
    133 call s:hi('Error', s:red, s:white, s:bold)
    134 
    135 " --- VimL ---------------------------------------------------------------------
    136 call s:hi('vimOption')
    137 call s:hi('vimGroup')
    138 call s:hi('vimHiClear')
    139 call s:hi('vimHiGroup')
    140 call s:hi('vimHiAttrib')
    141 call s:hi('vimHiGui')
    142 call s:hi('vimHiGuiFgBg')
    143 call s:hi('vimHiCTerm')
    144 call s:hi('vimHiCTermFgBg')
    145 call s:hi('vimSynType')
    146 hi link vimCommentTitle Comment
    147 
    148 " --- Ruby ---------------------------------------------------------------------
    149 call s:hi('rubyConstant')
    150 call s:hi('rubySharpBang', s:comment)
    151 call s:hi('rubyStringDelimiter', s:accent)
    152 call s:hi('rubyStringEscape', s:accent)
    153 call s:hi('rubyRegexpEscape', s:accent)
    154 call s:hi('rubyRegexpAnchor', s:accent)
    155 call s:hi('rubyRegexpSpecial', s:accent)
    156 
    157 " --- Elixir -------------------------------------------------------------------
    158 call s:hi('elixirAlias', s:default_fg, s:default_bg, s:none)
    159 call s:hi('elixirDelimiter', s:accent)
    160 call s:hi('elixirSelf', s:default_fg, s:default_bg, s:none)
    161 
    162 " For ||, ->, etc.
    163 call s:hi('elixirOperator')
    164 
    165 " Module attributes like @doc or @type.
    166 hi link elixirVariable Statement
    167 
    168 " While rendered as comments in other languages, docstrings are strings,
    169 " experimental.
    170 hi link elixirDocString String
    171 hi link elixirDocTest String
    172 hi link elixirStringDelimiter String
    173 
    174 " --- Perl ---------------------------------------------------------------------
    175 call s:hi('perlSharpBang', s:comment)
    176 call s:hi('perlStringStartEnd', s:accent)
    177 call s:hi('perlStringEscape', s:accent)
    178 call s:hi('perlMatchStartEnd', s:accent)
    179 
    180 " --- Python -------------------------------------------------------------------
    181 call s:hi('pythonEscape', s:accent)
    182 
    183 " --- JavaScript ---------------------------------------------------------------
    184 call s:hi('javaScriptFunction', s:black, s:default_bg, s:bold)
    185 
    186 " --- Diffs --------------------------------------------------------------------
    187 call s:hi('diffFile', s:faded)
    188 call s:hi('diffNewFile', s:faded)
    189 call s:hi('diffIndexLine', s:comment)
    190 call s:hi('diffLine', s:yellow)
    191 call s:hi('diffSubname', s:faded)
    192 call s:hi('diffAdded', s:green)
    193 call s:hi('diffRemoved', s:red)
    194 
    195 " --- Markdown -----------------------------------------------------------------
    196 call s:hi('Title', s:black, s:default_bg, s:bold)
    197 call s:hi('markdownHeadingDelimiter', s:black, s:default_bg, s:bold)
    198 call s:hi('markdownHeadingRule', s:black, s:default_bg, s:bold)
    199 call s:hi('markdownLinkText', s:blue, s:default_bg, s:underline)
    200 
    201 " --- HTML ---------------------------------------------------------------------
    202 call s:hi('htmlLink', s:blue, s:default_bg, s:underline)
    203 call s:hi('htmlArg', s:default_fg, s:default_bg)
    204 
    205 " --- Gemini -------------------------------------------------------------------
    206 " Based on this plugin: https://tildegit.org/sloum/gemini-vim-syntax
    207 call s:hi('gmiHeader', s:black, s:default_bg, s:bold)
    208 call s:hi('gmiLinkStart', s:black, s:default_bg, s:bold)
    209 call s:hi('gmiLinkURL', s:blue, s:default_bg, s:underline)
    210 call s:hi('gmiLinkTitle', s:accent, s:default_bg, s:none)
    211 call s:hi('gmiMono', s:accent, s:default_bg, s:bold)
    212 call s:hi('gmiQuoteLine', s:accent, s:default_bg, s:bold)
    213 
    214 " --- Spelling -----------------------------------------------------------------
    215 call s:hi('SpellBad', s:red, s:default_bg, s:bold, s:underline)
    216 call s:hi('SpellCap', s:black, s:default_bg, s:bold)
    217 call s:hi('SpellLocal', s:default_fg, s:default_bg, s:none)
    218 call s:hi('SpellRare', s:default_fg, s:default_bg, s:none)