bocau.vim 6.5 KB

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