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.vim (6864B)


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