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