vividchalk.vim 6.7 KB

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