calmar256-light.vim 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. " Vim color file: calmar256-dark.vim
  2. " Last Change: 21. Aug 2007
  3. " License: public domain
  4. " Maintainer:: calmar <mac@calmar.ws>
  5. "
  6. " for a 256 color capable terminal like xterm-256color, ... or gvim as well
  7. " "{{{
  8. " it only works in such a terminal and when you have:
  9. " set t_Co=256
  10. " in your vimrc"}}}
  11. " {{{ t_Co=256 is set - check
  12. if &t_Co != 256 && ! has("gui_running")
  13. echomsg ""
  14. echomsg "write 'set t_Co=256' in your .vimrc or this file won't load"
  15. echomsg ""
  16. finish
  17. endif
  18. " }}}
  19. " {{{ reset colors and set colors_name and store cpo setting
  20. set background=dark
  21. hi clear
  22. if exists("syntax_on")
  23. syntax reset
  24. endif
  25. let g:colors_name = "calmar256-light"
  26. let s:save_cpo = &cpo
  27. set cpo&vim
  28. " }}}
  29. " FORMAT:"{{{
  30. "
  31. " \ ["color-group", "term-style", "foreground-color", "background-color", "gui-style", "under-curl-color" ],
  32. "
  33. " 'term-style'/'gui-style' can be:
  34. " bold, underline, undercurl, reverse, inverse, italic, standout, NONE
  35. "
  36. " if gui-style is empty, the term-style value is used for the gui
  37. "
  38. " (Note: not everything is supported by a terminal nor the gui)
  39. "
  40. " besides empty values defaults to 'NONE"
  41. "
  42. " may also check: :help highlight-groups
  43. " :help hl-<highlight-group> "
  44. "
  45. " for the Color numbers (0-255) for the foreground/background and under-curl-colors:
  46. " http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
  47. "}}}
  48. "============================================================
  49. " EDIT/ADD your style/colors below
  50. "------------------------------------------------------------
  51. " Format: \ ["color-group",
  52. " "term-style",
  53. " "foreground-color",
  54. " "background-color",
  55. " "gui-style",
  56. " "under-curl-color" ],
  57. let s:colors256 = [
  58. \ ["Normal", "", "17", "230", "", "" ],
  59. \ ["Cursor", "", "", "226", "", "" ],
  60. \ ["CursorLine", "", "", "222", "", "" ],
  61. \ ["CursorColumn", "", "", "223", "", "" ],
  62. \ ["Incsearch", "bold", "195", "28", "", "" ],
  63. \ ["Search", "", "", "119", "", "" ],
  64. \ ["ErrorMsg", "bold", "16", "202", "", "" ],
  65. \ ["WarningMsg", "bold", "16", "190", "", "" ],
  66. \ ["ModeMsg", "bold", "16", "51", "", "" ],
  67. \ ["MoreMsg", "bold", "16", "154", "", "" ],
  68. \ ["Question", "bold", "27", "", "", "" ],
  69. \ ["StatusLine", "", "231", "30", "", "" ],
  70. \ ["StatusLineNC", "", "20", "250", "", "" ],
  71. \ ["User1", "bold", "28", "", "", "" ],
  72. \ ["User2", "bold", "39", "", "", "" ],
  73. \ ["VertSplit", "", "84", "22", "", "" ],
  74. \ ["WildMenu", "bold", "87", "35", "", "" ],
  75. \ ["DiffText", "", "16", "190", "", "" ],
  76. \ ["DiffChange", "", "16", "83", "", "" ],
  77. \ ["DiffDelete", "", "79", "124", "", "" ],
  78. \ ["DiffAdd", "", "79", "21", "", "" ],
  79. \ ["Folded", "bold", "19", "115", "", "" ],
  80. \ ["FoldedColumn", "", "39", "190", "", "" ],
  81. \ ["FoldColumn", "", "19", "115", "", "" ],
  82. \ ["Directory", "", "28", "", "", "" ],
  83. \ ["LineNr", "", "63", "228", "", "" ],
  84. \ ["NonText", "", "243", "229", "", "" ],
  85. \ ["SpecialKey", "", "190", "", "", "" ],
  86. \ ["Title", "bold", "18", "", "", "" ],
  87. \ ["Visual", "", "", "220", "", "" ],
  88. \ ["Comment", "", "21", "255", "", "" ],
  89. \ ["Costant", "", "58", "", "", "" ],
  90. \ ["String", "", "160", "", "", "" ],
  91. \ ["Error", "", "130", "", "", "" ],
  92. \ ["Identifier", "", "31", "", "", "" ],
  93. \ ["Ignore", "", "", "", "", "" ],
  94. \ ["Number", "bold", "23", "", "", "" ],
  95. \ ["PreProc", "", "26", "255", "", "" ],
  96. \ ["Special", "", "", "229", "", "" ],
  97. \ ["SpecialChar", "", "22", "", "", "" ],
  98. \ ["Statement", "", "36", "", "", "" ],
  99. \ ["Todo", "", "", "229", "", "" ],
  100. \ ["Type", "", "20", "", "", "" ],
  101. \ ["Underlined", "bold", "25", "", "", "" ],
  102. \ ["TaglistTagName","bold", "29", "118", "", "" ]]
  103. let s:colorvim7 = [
  104. \ ["Pmenu", "", "229", "29", "", "" ],
  105. \ ["PmenuSel", "bold", "232", "226", "", "" ],
  106. \ ["PmenuSbar", "", "16", "119", "", "" ],
  107. \ ["PmenuThumb", "", "16", "11", "", "" ],
  108. \ ["SpellBad", "undercurl", "","", "undercurl","160" ],
  109. \ ["SpellRare", "", "", "228", "", "" ],
  110. \ ["SpellLocal", "", "", "224", "", "" ],
  111. \ ["SpellCap", "", "", "247", "", "" ],
  112. \ ["MatchParen", "bold", "15", "22", "", "" ],
  113. \ ["TabLine", "", "252", "22", "", "" ],
  114. \ ["TabLineSel", "bold", "253", "30", "", "" ],
  115. \ ["TabLineFill", "", "247", "16", "", "" ]]
  116. "============================================================
  117. " * NO NEED * to edit below (unless bugfixing)
  118. "============================================================
  119. "
  120. " {{{ change empty fields to "NONE"
  121. for s:col in s:colors256
  122. for i in [1, 2, 3, 4, 5]
  123. if s:col[i] == ""
  124. let s:col[i] = "NONE"
  125. endif
  126. endfor
  127. endfor
  128. for s:col in s:colorvim7
  129. for i in [1, 2, 3, 4, 5]
  130. if s:col[i] == ""
  131. let s:col[i] = "NONE"
  132. endif
  133. endfor
  134. endfor
  135. " }}}
  136. " {{{ check args helper function
  137. function! s:checkargs(arg)
  138. if a:arg+0 == 0 && a:arg != "0" "its a string
  139. return a:arg
  140. else
  141. return s:cmap[a:arg+0] "get rgb color based on the number
  142. endif
  143. endfunction
  144. " }}}
  145. " {{{ guisetcolor helper function
  146. "
  147. function! s:guisetcolor(colarg)
  148. " if gui-style is empty use (c)term-style also for gui
  149. if a:colarg[4] == ""
  150. let guival = a:colarg[1]
  151. else
  152. let guival = a:colarg[4]
  153. endif
  154. let fg = s:checkargs(a:colarg[2])
  155. let bg = s:checkargs(a:colarg[3])
  156. let sp = s:checkargs(a:colarg[5])
  157. exec "hi ".a:colarg[0]." gui=".guival." guifg=".fg." guibg=".bg." guisp=".sp
  158. endfunction
  159. " }}}
  160. " {{{ color setup for terminal
  161. if ! has("gui_running")
  162. for s:col in s:colors256
  163. exec "hi ".s:col[0]." cterm=".s:col[1]." ctermfg=".s:col[2]." ctermbg=".s:col[3]
  164. endfor
  165. if v:version >= 700
  166. for s:col in s:colorvim7
  167. exec "hi ".s:col[0]." cterm=".s:col[1]." ctermfg=".s:col[2]." ctermbg=".s:col[3]
  168. endfor
  169. endif
  170. else
  171. " }}}
  172. " color-mapping array {{{
  173. " number of vim colors and #html colors equivalent for gui
  174. let s:cmap = [
  175. \ "#000000", "#800000", "#008000", "#808000",
  176. \ "#000080", "#800080", "#008080", "#c0c0c0",
  177. \ "#808080", "#ff0000", "#00ff00", "#ffff00",
  178. \ "#0000ff", "#ff00ff", "#00ffff", "#ffffff",
  179. \
  180. \ "#000000", "#00005f", "#000087", "#0000af", "#0000d7", "#0000ff",
  181. \ "#005f00", "#005f5f", "#005f87", "#005faf", "#005fd7", "#005fff",
  182. \ "#008700", "#00875f", "#008787", "#0087af", "#0087d7", "#0087ff",
  183. \ "#00af00", "#00af5f", "#00af87", "#00afaf", "#00afd7", "#00afff",
  184. \ "#00d700", "#00d75f", "#00d787", "#00d7af", "#00d7d7", "#00d7ff",
  185. \ "#00ff00", "#00ff5f", "#00ff87", "#00ffaf", "#00ffd7", "#00ffff",
  186. \ "#5f0000", "#5f005f", "#5f0087", "#5f00af", "#5f00d7", "#5f00ff",
  187. \ "#5f5f00", "#5f5f5f", "#5f5f87", "#5f5faf", "#5f5fd7", "#5f5fff",
  188. \ "#5f8700", "#5f875f", "#5f8787", "#5f87af", "#5f87d7", "#5f87ff",
  189. \ "#5faf00", "#5faf5f", "#5faf87", "#5fafaf", "#5fafd7", "#5fafff",
  190. \ "#5fd700", "#5fd75f", "#5fd787", "#5fd7af", "#5fd7d7", "#5fd7ff",
  191. \ "#5fff00", "#5fff5f", "#5fff87", "#5fffaf", "#5fffd7", "#5fffff",
  192. \ "#870000", "#87005f", "#870087", "#8700af", "#8700d7", "#8700ff",
  193. \ "#875f00", "#875f5f", "#875f87", "#875faf", "#875fd7", "#875fff",
  194. \ "#878700", "#87875f", "#878787", "#8787af", "#8787d7", "#8787ff",
  195. \ "#87af00", "#87af5f", "#87af87", "#87afaf", "#87afd7", "#87afff",
  196. \ "#87d700", "#87d75f", "#87d787", "#87d7af", "#87d7d7", "#87d7ff",
  197. \ "#87ff00", "#87ff5f", "#87ff87", "#87ffaf", "#87ffd7", "#87ffff",
  198. \ "#af0000", "#af005f", "#af0087", "#af00af", "#af00d7", "#af00ff",
  199. \ "#af5f00", "#af5f5f", "#af5f87", "#af5faf", "#af5fd7", "#af5fff",
  200. \ "#af8700", "#af875f", "#af8787", "#af87af", "#af87d7", "#af87ff",
  201. \ "#afaf00", "#afaf5f", "#afaf87", "#afafaf", "#afafd7", "#afafff",
  202. \ "#afd700", "#afd75f", "#afd787", "#afd7af", "#afd7d7", "#afd7ff",
  203. \ "#afff00", "#afff5f", "#afff87", "#afffaf", "#afffd7", "#afffff",
  204. \ "#d70000", "#d7005f", "#d70087", "#d700af", "#d700d7", "#d700ff",
  205. \ "#d75f00", "#d75f5f", "#d75f87", "#d75faf", "#d75fd7", "#d75fff",
  206. \ "#d78700", "#d7875f", "#d78787", "#d787af", "#d787d7", "#d787ff",
  207. \ "#d7af00", "#d7af5f", "#d7af87", "#d7afaf", "#d7afd7", "#d7afff",
  208. \ "#d7d700", "#d7d75f", "#d7d787", "#d7d7af", "#d7d7d7", "#d7d7ff",
  209. \ "#d7ff00", "#d7ff5f", "#d7ff87", "#d7ffaf", "#d7ffd7", "#d7ffff",
  210. \ "#ff0000", "#ff005f", "#ff0087", "#ff00af", "#ff00d7", "#ff00ff",
  211. \ "#ff5f00", "#ff5f5f", "#ff5f87", "#ff5faf", "#ff5fd7", "#ff5fff",
  212. \ "#ff8700", "#ff875f", "#ff8787", "#ff87af", "#ff87d7", "#ff87ff",
  213. \ "#ffaf00", "#ffaf5f", "#ffaf87", "#ffafaf", "#ffafd7", "#ffafff",
  214. \ "#ffd700", "#ffd75f", "#ffd787", "#ffd7af", "#ffd7d7", "#ffd7ff",
  215. \ "#ffff00", "#ffff5f", "#ffff87", "#ffffaf", "#ffffd7", "#ffffff",
  216. \
  217. \ "#080808", "#121212", "#1c1c1c", "#262626", "#303030", "#3a3a3a",
  218. \ "#444444", "#4e4e4e", "#585858", "#606060", "#666666", "#767676",
  219. \ "#808080", "#8a8a8a", "#949494", "#9e9e9e", "#a8a8a8", "#b2b2b2",
  220. \ "#bcbcbc", "#c6c6c6", "#d0d0d0", "#dadada", "#e4e4e4", "#eeeeee" ]
  221. " }}}
  222. " {{{ color setup for gvim
  223. for s:col in s:colors256
  224. call s:guisetcolor(s:col)
  225. endfor
  226. if v:version >= 700
  227. for s:col in s:colorvim7
  228. call s:guisetcolor(s:col)
  229. endfor
  230. endif
  231. endif
  232. " }}}
  233. let &cpo = s:save_cpo " restoring &cpo value
  234. " vim: set fdm=marker fileformat=unix: