[download]

vim/gvimrc

   1 set vb t_vb=
   2 
   3 set titlestring=%F%{&mod?'*':''}\ -\ Gvim guioptions-=T
   4 set showtabline=2 guitablabel=%N:%t%{&mod?'*':''} guitabtooltip=%F
   5 
   6 set guifont=Liberation\ Mono\ 10
   7 set number cursorline colorcolumn=81
   8 set guicursor+=a:blinkwait500-blinkon500-blinkoff500
   9 
  10 let ale_sign_error   = '>>'
  11 let ale_sign_warning = '>>'
  12 let $FZF_PREVIEW_COMMAND='cat {}'
  13 
  14 " Colors {{{
  15 
  16 function! s:hi(...) " {{{
  17     let l:exec  = ['hi!', a:1]
  18     let l:exec += [a:0 > 1 ? 'guifg='.a:2 : '']
  19     let l:exec += [a:0 > 2 ? 'guibg='.a:3 : '']
  20     let l:exec += ['gui=NONE'.(a:0 > 3 ? ','.a:4 : '')]
  21 
  22     exec join(l:exec, ' ')
  23 endfunction " }}}
  24 function! s:ln(dsc, src) " {{{
  25     exec join(['hi! link', a:dsc, a:src], ' ')
  26 endfunction " }}}
  27 function! s:ad(color, mul) " {{{
  28     let r = float2nr(round(str2nr(a:color[1:2], 16) * a:mul))
  29     let g = float2nr(round(str2nr(a:color[3:4], 16) * a:mul))
  30     let b = float2nr(round(str2nr(a:color[5:6], 16) * a:mul))
  31 
  32     return printf('#%02x%02x%02x', r, g, b)
  33 endfunction " }}}
  34 
  35 hi clear
  36 syntax on
  37 source ~/.theme/vim
  38 
  39 let s:bg = '#fdfdfd'
  40 let s:fg = '#111111'
  41 
  42 let s:str = '#800000'
  43 let s:num = '#000080'
  44 let s:msg = '#008000'
  45 let s:hlt = '#ffa500'
  46 let s:com = '#999999'
  47 
  48 if background != '#222228'
  49     let s:bg = foreground
  50     let s:fg = background
  51 
  52     let s:str = red1
  53     let s:num = blue1
  54     let s:msg = green1
  55     let s:hlt = yellow1
  56     let s:com = black2
  57 endif
  58 
  59 let s:gui = s:ad(s:bg, 0.96)
  60 let s:non = s:ad(s:bg, 0.74)
  61 
  62 let terminal_ansi_colors = [
  63     \ color0,   color1,   color2,   color3,
  64     \ color4,   color5,   color6,   color7,
  65     \ color8,   color9,   color10,  color11,
  66     \ color12,  color13,  color14,  color15,
  67 \ ]
  68 
  69 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  70 
  71 call s:hi('Normal', s:fg, s:bg)
  72 " call s:hi('Visual', 'NONE', 'NONE', 'reverse')
  73 
  74 call s:hi('Number',   s:num)
  75 call s:hi('Boolean',  s:fg)
  76 call s:hi('Constant', s:str)
  77 call s:hi('Comment',  s:com)
  78 
  79 call s:hi('Statement',  s:fg, 'NONE', 'bold')
  80 call s:ln('Type',       'Statement')
  81 call s:ln('Identifier', 'Boolean')
  82 call s:ln('Operator',   'Boolean')
  83 call s:ln('PreProc',    'Statement')
  84 
  85 call s:ln('Special',        'Boolean')
  86 call s:ln('SpecialChar',    'Constant')
  87 call s:ln('SpecialComment', 'Comment')
  88 
  89 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  90 
  91 call s:hi('Error', s:str, 'NONE')
  92 call s:hi('Todo',  s:hlt, 'NONE', 'bold')
  93 
  94 call s:hi('NonText',    s:non, 'NONE')
  95 call s:ln('SpecialKey', 'NonText')
  96 
  97 call s:hi('Search',     s:fg,   s:hlt)
  98 call s:hi('IncSearch',  'NONE', 'NONE', 'reverse')
  99 call s:hi('MatchParen', s:fg,   s:hlt)
 100 
 101 call s:hi('Pmenu',    s:fg, s:gui)
 102 call s:hi('PmenuSel', s:fg, s:gui, 'bold,reverse')
 103 
 104 call s:hi('DiffAdd',    s:fg, s:msg)
 105 call s:hi('DiffChange', s:fg, s:hlt)
 106 call s:hi('DiffDelete', s:bg, s:str)
 107 call s:hi('DiffText',   s:fg, s:gui, 'NONE')
 108 
 109 call s:hi('Underlined', 'NONE', 'NONE', 'underline')
 110 
 111 call s:hi('SpellBad', 'NONE', 'NONE', 'undercurl, guisp='.s:str)
 112 call s:hi('SpellCap', 'NONE', 'NONE', 'undercurl, guisp='.s:num)
 113 
 114 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 115 
 116 call s:hi('LineNr',     s:com,  'NONE')
 117 call s:hi('SignColumn', 'NONE', 'NONE')
 118 
 119 call s:ln('Folded',     'LineNr')
 120 call s:ln('FoldColumn', 'Folded')
 121 
 122 call s:hi('CursorLine',   'NONE', s:gui)
 123 call s:hi('CursorLineNr', s:com,  s:gui)
 124 
 125 call s:ln('ColorColumn', 'CursorLine')
 126 call s:hi('VertSplit',   s:gui, s:gui)
 127 
 128 call s:hi('ALEErrorSign',   s:str, 'NONE', 'bold')
 129 call s:hi('ALEWarningSign', s:num, 'NONE', 'bold')
 130 
 131 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 132 
 133 call s:hi('StatusLine',   s:fg, s:gui, 'bold')
 134 call s:hi('StatusLineNC', s:fg, s:bg,  'reverse')
 135 
 136 call s:hi('ModeNormal',  s:bg, s:fg,  'bold')
 137 call s:hi('ModeInsert',  s:bg, s:num, 'bold')
 138 call s:hi('ModeVisual',  s:bg, s:hlt, 'bold')
 139 call s:hi('ModeReplace', s:bg, s:str, 'bold')
 140 
 141 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 142 
 143 call s:hi('Title',    s:fg, 'NONE', 'bold')
 144 call s:ln('Question', 'Title')
 145 
 146 call s:ln('ModeMsg', 'Title')
 147 call s:ln('MoreMsg', 'Title')
 148 
 149 call s:ln('ErrorMsg',   'Error')
 150 call s:ln('WarningMsg', 'Error')
 151 
 152 call s:ln('WildMenu',  'PmenuSel')
 153 call s:ln('Directory', 'Title')
 154 
 155 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 156 
 157 call s:ln('javascriptNumber',      'Number')
 158 call s:ln('javascriptVariable',    'Statement')
 159 call s:ln('javascriptObjectLabel', 'Boolean')
 160 
 161 call s:ln('luaFunction', 'Statement')
 162 call s:ln('luaOperator', 'Statement')
 163 
 164 call s:ln('diffAdded',   'DiffAdd')
 165 call s:ln('diffRemoved', 'DiffDelete')
 166 
 167 " }}}