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 (6781B)


      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      = ['#111111', 0]
     17 let s:red        = ['#994444', 1]
     18 let s:green      = ['#449944', 2]
     19 let s:yellow     = ['#999444', 3]
     20 let s:cyan       = ['#449999', 6]
     21 let s:white      = ['#DDDDDD', 7]
     22 let s:accent     = ['#5F5F5F', 59]
     23 let s:cursorline = ['#262626', 235]
     24 let s:comment    = ['#6C6C6C', 242]
     25 let s:faded      = ['#A8A8A8', 248]
     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 && bg != s:default_bg
     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')
     70 call s:hi('Cursor', s:black, s:white)
     71 call s:hi('CursorLine', s:default_lst, s:cursorline, s:none)
     72 call s:hi('CursorLineNr', s:white, s:default_bg, s:bold)
     73 call s:hi('ColorColumn', s:default_lst, s:cursorline)
     74 call s:hi('Search', s:white, s:accent)
     75 call s:hi('Visual', s:white, s:accent)
     76 call s:hi('ErrorMsg', s:white, s:red)
     77 
     78 " Tildes at the bottom of a buffer, etc.
     79 call s:hi('NonText', s:faded)
     80 
     81 " Folding.
     82 call s:hi('FoldColumn', s:faded)
     83 call s:hi('Folded')
     84 
     85 " Line numbers gutter.
     86 call s:hi('LineNr', s:faded)
     87 
     88 " Small arrow used for tabs.
     89 call s:hi('SpecialKey', s:accent, s:default_bg, s:bold)
     90 
     91 " File browsers.
     92 call s:hi('Directory', s:white, s:default_bg, s:bold)
     93 
     94 " Help.
     95 call s:hi('helpSpecial')
     96 call s:hi('helpHyperTextJump', s:accent, s:default_bg, s:underline)
     97 call s:hi('helpNote')
     98 
     99 " Popup menu.
    100 call s:hi('Pmenu', s:white, s:accent)
    101 call s:hi('PmenuSel', s:accent, s:white)
    102 
    103 " Notes.
    104 call s:hi('Todo', s:white, s:default_bg, s:bold)
    105 
    106 " Signs.
    107 call s:hi('SignColumn')
    108 
    109 " --- Programming languages ----------------------------------------------------
    110 call s:hi('Statement', s:white, s:default_bg, s:bold)
    111 call s:hi('PreProc', s:white, s:default_bg, s:bold)
    112 call s:hi('String', s:accent)
    113 call s:hi('Comment', s:comment, s:default_bg, s:comment_attr)
    114 call s:hi('Constant', s:accent, s:default_bg, s:bold)
    115 call s:hi('Number', s:accent)
    116 call s:hi('Type', s:white, s:default_bg, s:bold)
    117 call s:hi('Function', s:white)
    118 call s:hi('Identifier', s:default_fg, s:default_bg, s:none)
    119 call s:hi('Special')
    120 call s:hi('MatchParen', s:white, s:black, s:underline)
    121 call s:hi('Error', s:red, s:black, s:bold)
    122 
    123 " --- VimL ---------------------------------------------------------------------
    124 call s:hi('vimOption')
    125 call s:hi('vimGroup')
    126 call s:hi('vimHiClear')
    127 call s:hi('vimHiGroup')
    128 call s:hi('vimHiAttrib')
    129 call s:hi('vimHiGui')
    130 call s:hi('vimHiGuiFgBg')
    131 call s:hi('vimHiCTerm')
    132 call s:hi('vimHiCTermFgBg')
    133 call s:hi('vimSynType')
    134 hi link vimCommentTitle Comment
    135 
    136 " --- Ruby ---------------------------------------------------------------------
    137 call s:hi('rubyConstant')
    138 call s:hi('rubySharpBang', s:comment)
    139 call s:hi('rubyStringDelimiter', s:accent)
    140 call s:hi('rubyStringEscape', s:accent)
    141 call s:hi('rubyRegexpEscape', s:accent)
    142 call s:hi('rubyRegexpAnchor', s:accent)
    143 call s:hi('rubyRegexpSpecial', s:accent)
    144 
    145 " --- Elixir -------------------------------------------------------------------
    146 call s:hi('elixirAlias', s:default_fg, s:default_bg, s:none)
    147 call s:hi('elixirDelimiter', s:accent)
    148 call s:hi('elixirSelf', s:default_fg, s:default_bg, s:none)
    149 
    150 " For ||, ->, etc.
    151 call s:hi('elixirOperator')
    152 
    153 " Module attributes like @doc or @type.
    154 hi link elixirVariable Statement
    155 
    156 " While rendered as comments in other languages, docstrings are strings,
    157 " experimental.
    158 hi link elixirDocString String
    159 hi link elixirDocTest String
    160 hi link elixirStringDelimiter String
    161 
    162 " --- Perl ---------------------------------------------------------------------
    163 call s:hi('perlSharpBang', s:comment)
    164 call s:hi('perlStringStartEnd', s:accent)
    165 call s:hi('perlStringEscape', s:accent)
    166 call s:hi('perlMatchStartEnd', s:accent)
    167 
    168 " --- Python -------------------------------------------------------------------
    169 call s:hi('pythonEscape', s:accent)
    170 
    171 " --- JavaScript ---------------------------------------------------------------
    172 call s:hi('javaScriptFunction', s:white, s:default_bg, s:bold)
    173 
    174 " --- Diffs --------------------------------------------------------------------
    175 call s:hi('diffFile', s:faded)
    176 call s:hi('diffNewFile', s:faded)
    177 call s:hi('diffIndexLine', s:comment)
    178 call s:hi('diffLine', s:yellow)
    179 call s:hi('diffSubname', s:faded)
    180 call s:hi('diffAdded', s:green)
    181 call s:hi('diffRemoved', s:red)
    182 
    183 " --- Markdown -----------------------------------------------------------------
    184 call s:hi('Title', s:white, s:default_bg, s:bold)
    185 call s:hi('markdownHeadingDelimiter', s:white, s:default_bg, s:bold)
    186 call s:hi('markdownHeadingRule', s:white, s:default_bg, s:bold)
    187 call s:hi('markdownLinkText', s:cyan, s:default_bg, s:underline)
    188 
    189 " --- HTML ---------------------------------------------------------------------
    190 call s:hi('htmlLink', s:cyan, s:default_bg, s:underline)
    191 call s:hi('htmlArg', s:default_fg, s:default_bg)
    192 
    193 " --- Gemini -------------------------------------------------------------------
    194 " Bsed off of the following plugin: https://tildegit.org/sloum/gemini-vim-syntax
    195 call s:hi('gmiHeader', s:white, s:default_bg, s:bold)
    196 call s:hi('gmiLinkStart', s:white, s:default_bg, s:bold)
    197 call s:hi('gmiLinkURL', s:cyan, s:default_bg, s:underline)
    198 call s:hi('gmiLinkTitle', s:accent, s:default_bg, s:none)
    199 call s:hi('gmiMono', s:accent, s:default_bg, s:bold)
    200 call s:hi('gmiQuoteLine', s:accent, s:default_bg, s:bold)
    201 
    202 " --- Spelling -----------------------------------------------------------------
    203 call s:hi('SpellBad', s:red, s:default_bg, s:bold, s:underline)
    204 call s:hi('SpellCap', s:white, s:default_bg, s:bold)
    205 call s:hi('SpellLocal', s:default_fg, s:default_bg, s:none)
    206 call s:hi('SpellRare', s:default_fg, s:default_bg, s:none)
    207 
    208 " --- Diff Mode ----------------------------------------------------------------
    209 call s:hi('DiffAdd', s:green, s:default_bg)
    210 call s:hi('DiffDelete', s:red, s:default_bg)
    211 call s:hi('DiffChange', s:white, s:default_bg)
    212 call s:hi('DiffText', s:yellow, s:default_bg)