vim-monochrome

A custom monochromatic Vim colourscheme.
git clone https://git.jaderune.net/jbauer/vim-monochrome
Log | Files | Refs | README | LICENSE

monochrome.vim (7005B)


      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 " Tabs
     83 call s:hi('TabLine', s:white, s:faded)
     84 call s:hi('TabLineSel', s:white, s:accent, s:bold)
     85 call s:hi('TabLineFill', s:white, s:black)
     86 
     87 " Tildes at the bottom of a buffer, etc.
     88 call s:hi('NonText', s:faded)
     89 
     90 " Folding.
     91 call s:hi('FoldColumn', s:faded)
     92 call s:hi('Folded')
     93 
     94 " Line numbers gutter.
     95 call s:hi('LineNr', s:accent)
     96 
     97 " Small arrow used for tabs.
     98 call s:hi('SpecialKey', s:accent, s:default_bg, s:bold)
     99 
    100 " File browsers.
    101 call s:hi('Directory', s:white, s:default_bg, s:bold)
    102 
    103 " Help.
    104 call s:hi('helpSpecial')
    105 call s:hi('helpHyperTextJump', s:accent, s:default_bg, s:underline)
    106 call s:hi('helpNote')
    107 
    108 " Popup menu.
    109 call s:hi('Pmenu', s:white, s:accent)
    110 call s:hi('PmenuSel', s:accent, s:white)
    111 
    112 " Notes.
    113 call s:hi('Todo', s:white, s:default_bg, s:bold)
    114 
    115 " Signs.
    116 call s:hi('SignColumn')
    117 
    118 " --- Diff Mode ----------------------------------------------------------------
    119 call s:hi('DiffAdd', s:green, s:default_bg)
    120 call s:hi('DiffDelete', s:red, s:default_bg)
    121 call s:hi('DiffChange', s:white, s:default_bg)
    122 call s:hi('DiffText', s:yellow, s:default_bg)
    123 
    124 " --- Programming languages ----------------------------------------------------
    125 call s:hi('Statement', s:white, s:default_bg, s:bold)
    126 call s:hi('PreProc', s:white, s:default_bg, s:bold)
    127 call s:hi('String', s:accent)
    128 call s:hi('Comment', s:comment, s:default_bg, s:comment_attr)
    129 call s:hi('Constant', s:accent, s:default_bg, s:bold)
    130 call s:hi('Number', s:accent)
    131 call s:hi('Type', s:white, s:default_bg, s:bold)
    132 call s:hi('Function', s:white)
    133 call s:hi('Identifier', s:default_fg, s:default_bg, s:none)
    134 call s:hi('Special')
    135 call s:hi('MatchParen', s:white, s:black, s:underline)
    136 call s:hi('Error', s:red, s:black, s:bold)
    137 
    138 " --- VimL ---------------------------------------------------------------------
    139 call s:hi('vimOption')
    140 call s:hi('vimGroup')
    141 call s:hi('vimHiClear')
    142 call s:hi('vimHiGroup')
    143 call s:hi('vimHiAttrib')
    144 call s:hi('vimHiGui')
    145 call s:hi('vimHiGuiFgBg')
    146 call s:hi('vimHiCTerm')
    147 call s:hi('vimHiCTermFgBg')
    148 call s:hi('vimSynType')
    149 hi link vimCommentTitle Comment
    150 
    151 " --- Ruby ---------------------------------------------------------------------
    152 call s:hi('rubyConstant')
    153 call s:hi('rubySharpBang', s:comment)
    154 call s:hi('rubyStringDelimiter', s:accent)
    155 call s:hi('rubyStringEscape', s:accent)
    156 call s:hi('rubyRegexpEscape', s:accent)
    157 call s:hi('rubyRegexpAnchor', s:accent)
    158 call s:hi('rubyRegexpSpecial', s:accent)
    159 
    160 " --- Elixir -------------------------------------------------------------------
    161 call s:hi('elixirAlias', s:default_fg, s:default_bg, s:none)
    162 call s:hi('elixirDelimiter', s:accent)
    163 call s:hi('elixirSelf', s:default_fg, s:default_bg, s:none)
    164 
    165 " For ||, ->, etc.
    166 call s:hi('elixirOperator')
    167 
    168 " Module attributes like @doc or @type.
    169 hi link elixirVariable Statement
    170 
    171 " While rendered as comments in other languages, docstrings are strings,
    172 " experimental.
    173 hi link elixirDocString String
    174 hi link elixirDocTest String
    175 hi link elixirStringDelimiter String
    176 
    177 " --- Perl ---------------------------------------------------------------------
    178 call s:hi('perlSharpBang', s:comment)
    179 call s:hi('perlStringStartEnd', s:accent)
    180 call s:hi('perlStringEscape', s:accent)
    181 call s:hi('perlMatchStartEnd', s:accent)
    182 
    183 " --- Python -------------------------------------------------------------------
    184 call s:hi('pythonEscape', s:accent)
    185 
    186 " --- JavaScript ---------------------------------------------------------------
    187 call s:hi('javaScriptFunction', s:white, s:default_bg, s:bold)
    188 
    189 " --- Diffs --------------------------------------------------------------------
    190 call s:hi('diffFile', s:faded)
    191 call s:hi('diffNewFile', s:faded)
    192 call s:hi('diffIndexLine', s:comment)
    193 call s:hi('diffLine', s:yellow)
    194 call s:hi('diffSubname', s:faded)
    195 call s:hi('diffAdded', s:green)
    196 call s:hi('diffRemoved', s:red)
    197 
    198 " --- Markdown -----------------------------------------------------------------
    199 call s:hi('Title', s:white, s:default_bg, s:bold)
    200 call s:hi('markdownHeadingDelimiter', s:white, s:default_bg, s:bold)
    201 call s:hi('markdownHeadingRule', s:white, s:default_bg, s:bold)
    202 call s:hi('markdownLinkText', s:blue, s:default_bg, s:underline)
    203 
    204 " --- HTML ---------------------------------------------------------------------
    205 call s:hi('htmlLink', s:blue, s:default_bg, s:underline)
    206 call s:hi('htmlArg', s:default_fg, s:default_bg)
    207 
    208 " --- Gemini -------------------------------------------------------------------
    209 " Based on this plugin: https://tildegit.org/sloum/gemini-vim-syntax
    210 call s:hi('gmiHeader', s:white, s:default_bg, s:bold)
    211 call s:hi('gmiLinkStart', s:white, s:default_bg, s:bold)
    212 call s:hi('gmiLinkURL', s:blue, s:default_bg, s:underline)
    213 call s:hi('gmiLinkTitle', s:accent, s:default_bg, s:none)
    214 call s:hi('gmiMono', s:accent, s:default_bg, s:bold)
    215 call s:hi('gmiQuoteLine', s:accent, s:default_bg, s:bold)
    216 
    217 " --- Spelling -----------------------------------------------------------------
    218 call s:hi('SpellBad', s:red, s:default_bg, s:bold, s:underline)
    219 call s:hi('SpellCap', s:white, s:default_bg, s:bold)
    220 call s:hi('SpellLocal', s:default_fg, s:default_bg, s:none)
    221 call s:hi('SpellRare', s:default_fg, s:default_bg, s:none)