[download]

vim/gvimrc

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