| 
555
 | 
     1 " Vim color scheme
 | 
| 
 | 
     2 " Name:         vividchalk.vim
 | 
| 
 | 
     3 " Author:       Tim Pope <vimNOSPAM@tpope.info>
 | 
| 
 | 
     4 " Version:      2.0
 | 
| 
 | 
     5 " GetLatestVimScripts: 1891 1 :AutoInstall: vividchalk.vim
 | 
| 
 | 
     6 
 | 
| 
 | 
     7 " Based on the Vibrank Ink theme for TextMate
 | 
| 
 | 
     8 " Distributable under the same terms as Vim itself (see :help license)
 | 
| 
 | 
     9 
 | 
| 
 | 
    10 if has("gui_running")
 | 
| 
 | 
    11     set background=dark
 | 
| 
 | 
    12 endif
 | 
| 
 | 
    13 hi clear
 | 
| 
 | 
    14 if exists("syntax_on")
 | 
| 
 | 
    15    syntax reset
 | 
| 
 | 
    16 endif
 | 
| 
 | 
    17 
 | 
| 
 | 
    18 let colors_name = "vividchalk"
 | 
| 
 | 
    19 
 | 
| 
 | 
    20 " First two functions adapted from inkpot.vim
 | 
| 
 | 
    21 
 | 
| 
 | 
    22 " map a urxvt cube number to an xterm-256 cube number
 | 
| 
 | 
    23 fun! s:M(a)
 | 
| 
 | 
    24     return strpart("0245", a:a, 1) + 0
 | 
| 
 | 
    25 endfun
 | 
| 
 | 
    26 
 | 
| 
 | 
    27 " map a urxvt colour to an xterm-256 colour
 | 
| 
 | 
    28 fun! s:X(a)
 | 
| 
 | 
    29     if &t_Co == 88
 | 
| 
 | 
    30         return a:a
 | 
| 
 | 
    31     else
 | 
| 
 | 
    32         if a:a == 8
 | 
| 
 | 
    33             return 237
 | 
| 
 | 
    34         elseif a:a < 16
 | 
| 
 | 
    35             return a:a
 | 
| 
 | 
    36         elseif a:a > 79
 | 
| 
 | 
    37             return 232 + (3 * (a:a - 80))
 | 
| 
 | 
    38         else
 | 
| 
 | 
    39             let l:b = a:a - 16
 | 
| 
 | 
    40             let l:x = l:b % 4
 | 
| 
 | 
    41             let l:y = (l:b / 4) % 4
 | 
| 
 | 
    42             let l:z = (l:b / 16)
 | 
| 
 | 
    43             return 16 + s:M(l:x) + (6 * s:M(l:y)) + (36 * s:M(l:z))
 | 
| 
 | 
    44         endif
 | 
| 
 | 
    45     endif
 | 
| 
 | 
    46 endfun
 | 
| 
 | 
    47 
 | 
| 
 | 
    48 function! E2T(a)
 | 
| 
 | 
    49     return s:X(a:a)
 | 
| 
 | 
    50 endfunction
 | 
| 
 | 
    51 
 | 
| 
 | 
    52 function! s:choose(mediocre,good)
 | 
| 
 | 
    53     if &t_Co != 88 && &t_Co != 256
 | 
| 
 | 
    54         return a:mediocre
 | 
| 
 | 
    55     else
 | 
| 
 | 
    56         return s:X(a:good)
 | 
| 
 | 
    57     endif
 | 
| 
 | 
    58 endfunction
 | 
| 
 | 
    59 
 | 
| 
 | 
    60 function! s:hifg(group,guifg,first,second,...)
 | 
| 
 | 
    61     if a:0 && &t_Co == 256
 | 
| 
 | 
    62         let ctermfg = a:1
 | 
| 
 | 
    63     else
 | 
| 
 | 
    64         let ctermfg = s:choose(a:first,a:second)
 | 
| 
 | 
    65     endif
 | 
| 
 | 
    66     exe "highlight ".a:group." guifg=".a:guifg." ctermfg=".ctermfg
 | 
| 
 | 
    67 endfunction
 | 
| 
 | 
    68 
 | 
| 
 | 
    69 function! s:hibg(group,guibg,first,second)
 | 
| 
 | 
    70     let ctermbg = s:choose(a:first,a:second)
 | 
| 
 | 
    71     exe "highlight ".a:group." guibg=".a:guibg." ctermbg=".ctermbg
 | 
| 
 | 
    72 endfunction
 | 
| 
 | 
    73 
 | 
| 
 | 
    74 hi link railsMethod         PreProc
 | 
| 
 | 
    75 hi link rubyDefine          Keyword
 | 
| 
 | 
    76 hi link rubySymbol          Constant
 | 
| 
 | 
    77 hi link rubyAccess          rubyMethod
 | 
| 
 | 
    78 hi link rubyAttribute       rubyMethod
 | 
| 
 | 
    79 hi link rubyEval            rubyMethod
 | 
| 
 | 
    80 hi link rubyException       rubyMethod
 | 
| 
 | 
    81 hi link rubyInclude         rubyMethod
 | 
| 
 | 
    82 hi link rubyStringDelimiter rubyString
 | 
| 
 | 
    83 hi link rubyRegexp          Regexp
 | 
| 
 | 
    84 hi link rubyRegexpDelimiter rubyRegexp
 | 
| 
 | 
    85 "hi link rubyConstant        Variable
 | 
| 
 | 
    86 "hi link rubyGlobalVariable  Variable
 | 
| 
 | 
    87 "hi link rubyClassVariable   Variable
 | 
| 
 | 
    88 "hi link rubyInstanceVariable Variable
 | 
| 
 | 
    89 hi link javascriptRegexpString  Regexp
 | 
| 
 | 
    90 hi link javascriptNumber        Number
 | 
| 
 | 
    91 hi link javascriptNull          Constant
 | 
| 
 | 
    92 highlight link diffAdded        String
 | 
| 
 | 
    93 highlight link diffRemoved      Statement
 | 
| 
 | 
    94 highlight link diffLine         PreProc
 | 
| 
 | 
    95 highlight link diffSubname      Comment
 | 
| 
 | 
    96 
 | 
| 
 | 
    97 call s:hifg("Normal","#EEEEEE","White",87)
 | 
| 
 | 
    98 if &background == "light" || has("gui_running")
 | 
| 
 | 
    99     hi Normal guibg=Black ctermbg=Black
 | 
| 
 | 
   100 else
 | 
| 
 | 
   101     hi Normal guibg=Black ctermbg=NONE
 | 
| 
 | 
   102 endif
 | 
| 
 | 
   103 highlight StatusLine    guifg=Black   guibg=#aabbee gui=bold ctermfg=Black ctermbg=White  cterm=bold
 | 
| 
 | 
   104 highlight StatusLineNC  guifg=#444444 guibg=#aaaaaa gui=none ctermfg=Black ctermbg=Grey   cterm=none
 | 
| 
 | 
   105 "if &t_Co == 256
 | 
| 
 | 
   106     "highlight StatusLine ctermbg=117
 | 
| 
 | 
   107 "else
 | 
| 
 | 
   108     "highlight StatusLine ctermbg=43
 | 
| 
 | 
   109 "endif
 | 
| 
 | 
   110 
 | 
| 
 | 
   111 highlight Ignore        ctermfg=Black
 | 
| 
 | 
   112 highlight WildMenu      guifg=Black   guibg=#ffff00 gui=bold ctermfg=Black ctermbg=Yellow cterm=bold
 | 
| 
 | 
   113 highlight Cursor        guifg=Black guibg=White ctermfg=Black ctermbg=White
 | 
| 
 | 
   114 call s:hibg("ColorColumn","#333333","DarkGrey",81)
 | 
| 
 | 
   115 call s:hibg("CursorLine","#333333","DarkGrey",81)
 | 
| 
 | 
   116 call s:hibg("CursorColumn","#333333","DarkGrey",81)
 | 
| 
 | 
   117 highlight NonText       guifg=#404040 ctermfg=8
 | 
| 
 | 
   118 highlight SpecialKey    guifg=#404040 ctermfg=8
 | 
| 
 | 
   119 highlight Directory     none
 | 
| 
 | 
   120 high link Directory     Identifier
 | 
| 
 | 
   121 highlight ErrorMsg      guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE
 | 
| 
 | 
   122 highlight Search        guifg=NONE ctermfg=NONE gui=none cterm=none
 | 
| 
 | 
   123 call s:hibg("Search"    ,"#555555","DarkBlue",81)
 | 
| 
 | 
   124 highlight IncSearch     guifg=White guibg=Black ctermfg=White ctermbg=Black
 | 
| 
 | 
   125 highlight MoreMsg       guifg=#00AA00 ctermfg=Green
 | 
| 
 | 
   126 highlight LineNr        guifg=#DDEEFF ctermfg=White
 | 
| 
 | 
   127 call s:hibg("LineNr"    ,"#222222","DarkBlue",80)
 | 
| 
 | 
   128 highlight Question      none
 | 
| 
 | 
   129 high link Question      MoreMsg
 | 
| 
 | 
   130 highlight Title         guifg=Magenta ctermfg=Magenta
 | 
| 
 | 
   131 highlight VisualNOS     gui=none cterm=none
 | 
| 
 | 
   132 call s:hibg("Visual"    ,"#555577","LightBlue",83)
 | 
| 
 | 
   133 call s:hibg("VisualNOS" ,"#444444","DarkBlue",81)
 | 
| 
 | 
   134 call s:hibg("MatchParen","#1100AA","DarkBlue",18)
 | 
| 
 | 
   135 highlight WarningMsg    guifg=Red ctermfg=Red
 | 
| 
 | 
   136 highlight Error         ctermbg=DarkRed
 | 
| 
 | 
   137 highlight SpellBad      ctermbg=DarkRed
 | 
| 
 | 
   138 " FIXME: Comments
 | 
| 
 | 
   139 highlight SpellRare     ctermbg=DarkMagenta
 | 
| 
 | 
   140 highlight SpellCap      ctermbg=DarkBlue
 | 
| 
 | 
   141 highlight SpellLocal    ctermbg=DarkCyan
 | 
| 
 | 
   142 
 | 
| 
 | 
   143 call s:hibg("Folded"    ,"#110077","DarkBlue",17)
 | 
| 
 | 
   144 call s:hifg("Folded"    ,"#aaddee","LightCyan",63)
 | 
| 
 | 
   145 highlight FoldColumn    none
 | 
| 
 | 
   146 high link FoldColumn    Folded
 | 
| 
 | 
   147 highlight DiffAdd       ctermbg=4 guibg=DarkBlue
 | 
| 
 | 
   148 highlight DiffChange    ctermbg=5 guibg=DarkMagenta
 | 
| 
 | 
   149 highlight DiffDelete    ctermfg=12 ctermbg=6 gui=bold guifg=Blue guibg=DarkCyan
 | 
| 
 | 
   150 highlight DiffText      ctermbg=DarkRed
 | 
| 
 | 
   151 highlight DiffText      cterm=bold ctermbg=9 gui=bold guibg=Red
 | 
| 
 | 
   152 
 | 
| 
 | 
   153 highlight Pmenu         guifg=White ctermfg=White gui=bold cterm=bold
 | 
| 
 | 
   154 highlight PmenuSel      guifg=White ctermfg=White gui=bold cterm=bold
 | 
| 
 | 
   155 call s:hibg("Pmenu"     ,"#000099","Blue",18)
 | 
| 
 | 
   156 call s:hibg("PmenuSel"  ,"#5555ff","DarkCyan",39)
 | 
| 
 | 
   157 highlight PmenuSbar     guibg=Grey ctermbg=Grey
 | 
| 
 | 
   158 highlight PmenuThumb    guibg=White ctermbg=White
 | 
| 
 | 
   159 highlight TabLine       gui=underline cterm=underline
 | 
| 
 | 
   160 call s:hifg("TabLine"   ,"#bbbbbb","LightGrey",85)
 | 
| 
 | 
   161 call s:hibg("TabLine"   ,"#333333","DarkGrey",80)
 | 
| 
 | 
   162 highlight TabLineSel    guifg=White guibg=Black ctermfg=White ctermbg=Black
 | 
| 
 | 
   163 highlight TabLineFill   gui=underline cterm=underline
 | 
| 
 | 
   164 call s:hifg("TabLineFill","#bbbbbb","LightGrey",85)
 | 
| 
 | 
   165 call s:hibg("TabLineFill","#808080","Grey",83)
 | 
| 
 | 
   166 
 | 
| 
 | 
   167 hi Type gui=none
 | 
| 
 | 
   168 hi Statement gui=none
 | 
| 
 | 
   169 if !has("gui_mac")
 | 
| 
 | 
   170     " Mac GUI degrades italics to ugly underlining.
 | 
| 
 | 
   171     hi Comment gui=italic
 | 
| 
 | 
   172     hi railsUserClass  gui=italic
 | 
| 
 | 
   173     hi railsUserMethod gui=italic
 | 
| 
 | 
   174 endif
 | 
| 
 | 
   175 hi Identifier cterm=none
 | 
| 
 | 
   176 " Commented numbers at the end are *old* 256 color values
 | 
| 
 | 
   177 "highlight PreProc       guifg=#EDF8F9
 | 
| 
 | 
   178 call s:hifg("Comment"        ,"#9933CC","DarkMagenta",34) " 92
 | 
| 
 | 
   179 " 26 instead?
 | 
| 
 | 
   180 call s:hifg("Constant"       ,"#339999","DarkCyan",21) " 30
 | 
| 
 | 
   181 call s:hifg("rubyNumber"     ,"#CCFF33","Yellow",60) " 190
 | 
| 
 | 
   182 call s:hifg("String"         ,"#66FF00","LightGreen",44,82) " 82
 | 
| 
 | 
   183 call s:hifg("Identifier"     ,"#FFCC00","Yellow",72) " 220
 | 
| 
 | 
   184 call s:hifg("Statement"      ,"#FF6600","Brown",68) " 202
 | 
| 
 | 
   185 call s:hifg("PreProc"        ,"#AAFFFF","LightCyan",47) " 213
 | 
| 
 | 
   186 call s:hifg("railsUserMethod","#AACCFF","LightCyan",27)
 | 
| 
 | 
   187 call s:hifg("Type"           ,"#AAAA77","Grey",57) " 101
 | 
| 
 | 
   188 call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101
 | 
| 
 | 
   189 call s:hifg("Special"        ,"#33AA00","DarkGreen",24) " 7
 | 
| 
 | 
   190 call s:hifg("Regexp"         ,"#44B4CC","DarkCyan",21) " 74
 | 
| 
 | 
   191 call s:hifg("rubyMethod"     ,"#DDE93D","Yellow",77) " 191
 | 
| 
 | 
   192 "highlight railsMethod   guifg=#EE1122 ctermfg=1
 |