vividchalk.vim 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. call s:hibg("ColorColumn","#333333","DarkGrey",81)
  102. call s:hibg("CursorLine","#333333","DarkGrey",81)
  103. call s:hibg("CursorColumn","#333333","DarkGrey",81)
  104. highlight NonText guifg=#404040 ctermfg=8
  105. highlight SpecialKey guifg=#404040 ctermfg=8
  106. highlight Directory none
  107. high link Directory Identifier
  108. highlight ErrorMsg guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE
  109. highlight Search guifg=NONE ctermfg=NONE gui=none cterm=none
  110. call s:hibg("Search" ,"#555555","DarkBlue",81)
  111. highlight IncSearch guifg=White guibg=Black ctermfg=White ctermbg=Black
  112. highlight MoreMsg guifg=#00AA00 ctermfg=Green
  113. highlight LineNr guifg=#DDEEFF ctermfg=White
  114. call s:hibg("LineNr" ,"#222222","DarkBlue",80)
  115. highlight Question none
  116. high link Question MoreMsg
  117. highlight Title guifg=Magenta ctermfg=Magenta
  118. highlight VisualNOS gui=none cterm=none
  119. call s:hibg("Visual" ,"#555577","LightBlue",83)
  120. call s:hibg("VisualNOS" ,"#444444","DarkBlue",81)
  121. call s:hibg("MatchParen","#1100AA","DarkBlue",18)
  122. highlight WarningMsg guifg=Red ctermfg=Red
  123. highlight Error ctermbg=DarkRed
  124. highlight SpellBad ctermbg=DarkRed
  125. " FIXME: Comments
  126. highlight SpellRare ctermbg=DarkMagenta
  127. highlight SpellCap ctermbg=DarkBlue
  128. highlight SpellLocal ctermbg=DarkCyan
  129. call s:hibg("Folded" ,"#110077","DarkBlue",17)
  130. call s:hifg("Folded" ,"#aaddee","LightCyan",63)
  131. highlight FoldColumn none
  132. high link FoldColumn Folded
  133. highlight DiffAdd ctermbg=4 guibg=DarkBlue
  134. highlight DiffChange ctermbg=5 guibg=DarkMagenta
  135. highlight DiffDelete ctermfg=12 ctermbg=6 gui=bold guifg=Blue guibg=DarkCyan
  136. highlight DiffText ctermbg=DarkRed
  137. highlight DiffText cterm=bold ctermbg=9 gui=bold guibg=Red
  138. highlight Pmenu guifg=White ctermfg=White gui=bold cterm=bold
  139. highlight PmenuSel guifg=White ctermfg=White gui=bold cterm=bold
  140. call s:hibg("Pmenu" ,"#000099","Blue",18)
  141. call s:hibg("PmenuSel" ,"#5555ff","DarkCyan",39)
  142. highlight PmenuSbar guibg=Grey ctermbg=Grey
  143. highlight PmenuThumb guibg=White ctermbg=White
  144. highlight TabLine gui=underline cterm=underline
  145. call s:hifg("TabLine" ,"#bbbbbb","LightGrey",85)
  146. call s:hibg("TabLine" ,"#333333","DarkGrey",80)
  147. highlight TabLineSel guifg=White guibg=Black ctermfg=White ctermbg=Black
  148. highlight TabLineFill gui=underline cterm=underline
  149. call s:hifg("TabLineFill","#bbbbbb","LightGrey",85)
  150. call s:hibg("TabLineFill","#808080","Grey",83)
  151. hi Type gui=none
  152. hi Statement gui=none
  153. if !has("gui_mac")
  154. " Mac GUI degrades italics to ugly underlining.
  155. hi Comment gui=italic
  156. hi railsUserClass gui=italic
  157. hi railsUserMethod gui=italic
  158. endif
  159. hi Identifier cterm=none
  160. " Commented numbers at the end are *old* 256 color values
  161. "highlight PreProc guifg=#EDF8F9
  162. call s:hifg("Comment" ,"#9933CC","DarkMagenta",34) " 92
  163. " 26 instead?
  164. call s:hifg("Constant" ,"#339999","DarkCyan",21) " 30
  165. call s:hifg("rubyNumber" ,"#CCFF33","Yellow",60) " 190
  166. call s:hifg("String" ,"#66FF00","LightGreen",44,82) " 82
  167. call s:hifg("Identifier" ,"#FFCC00","Yellow",72) " 220
  168. call s:hifg("Statement" ,"#FF6600","Brown",68) " 202
  169. call s:hifg("PreProc" ,"#AAFFFF","LightCyan",47) " 213
  170. call s:hifg("railsUserMethod","#AACCFF","LightCyan",27)
  171. call s:hifg("Type" ,"#AAAA77","Grey",57) " 101
  172. call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101
  173. call s:hifg("Special" ,"#33AA00","DarkGreen",24) " 7
  174. call s:hifg("Regexp" ,"#44B4CC","DarkCyan",21) " 74
  175. call s:hifg("rubyMethod" ,"#DDE93D","Yellow",77) " 191
  176. "highlight railsMethod guifg=#EE1122 ctermfg=1