old-hope.vim 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. " ------------------------------------------------------------------------------
  2. " Author: j-tom
  3. " Source: https://github.com/j-tom/vim-old-hope
  4. " Note: Based on the 'An Old Hope' theme for Atom editor
  5. " (https://atom.io/themes/an-old-hope-syntax)
  6. " ------------------------------------------------------------------------------
  7. " Reset colors to default colorscheme {{{
  8. hi clear
  9. if exists("syntax_on")
  10. syntax reset
  11. endif
  12. " }}}
  13. " Variables {{{
  14. let g:colors_name="old-hope"
  15. " * Determine t_Co support
  16. let s:tCol = oldhope#GetTCo()
  17. " }}}
  18. " Colors {{{
  19. " * GUI
  20. let s:gWhite = "#FFFFFF"
  21. let s:gBlack = "#000000"
  22. let s:gVeryLightGrey = "#CBCDD2"
  23. let s:gLightGrey = "#848794"
  24. let s:gGrey = "#686B78"
  25. let s:gDarkGrey = "#45474F"
  26. let s:gVeryDarkGrey = "#1C1D21"
  27. let s:gRed = "#EB3D54"
  28. let s:gOrange = "#EF7C2A"
  29. let s:gYellow = "#E5CD52"
  30. let s:gGreen = "#78BD65"
  31. let s:gBlue = "#4FB4D8"
  32. " * t_Co 256 (cterm)
  33. if s:tCol == 256
  34. let s:tWhite = 15
  35. let s:tBlack = 0
  36. let s:tVeryLightGrey = 252
  37. let s:tLightGrey = 245
  38. let s:tGrey = 242
  39. let s:tDarkGrey = 238
  40. let s:tVeryDarkGrey = 234
  41. let s:tRed = 203 " 9, 197
  42. let s:tOrange = 202 " 166
  43. let s:tYellow = 221 " 222, 227
  44. let s:tGreen = 41 " 47
  45. let s:tBlue = 39 " 45
  46. " * t_Co 16
  47. elseif s:tCol == 16
  48. let s:tWhite = 15
  49. let s:tBlack = 0
  50. let s:tVeryLightGrey = 7
  51. let s:tLightGrey = 7
  52. let s:tGrey = 12
  53. let s:tDarkGrey = 8
  54. let s:tVeryDarkGrey = 0
  55. let s:tRed = 1
  56. let s:tOrange = 9
  57. let s:tYellow = 11
  58. let s:tGreen = 2
  59. let s:tBlue = 14
  60. " * t_Co 8
  61. else
  62. let s:tWhite = 7
  63. let s:tBlack = 0
  64. let s:tVeryLightGrey = 7
  65. let s:tLightGrey = 7
  66. let s:tGrey = 6
  67. let s:tDarkGrey = 0
  68. let s:tVeryDarkGrey = 0
  69. let s:tRed = 1
  70. let s:tOrange = 5
  71. let s:tYellow = 3
  72. let s:tGreen = 2
  73. let s:tBlue = 6
  74. endif
  75. " }}}
  76. " Variables {{{
  77. let s:gFg = s:gVeryLightGrey
  78. let s:tFg = s:tVeryLightGrey
  79. let s:gBg = s:gBlack
  80. let s:tBg = s:tBlack
  81. " let s:gBg = s:gVeryDarkGrey
  82. " let s:tBg = s:tVeryDarkGrey
  83. let s:vBold = {'GUI': "BOLD" , 'TERM': "NONE" }
  84. let s:vItalic = {'GUI': "ITALIC" , 'TERM': "NONE" }
  85. let s:vUnderline = {'GUI': "UNDERLINE" , 'TERM': "UNDERLINE" }
  86. let s:vNone = {'GUI': "NONE" , 'TERM': "NONE" }
  87. let s:vBoldItalic = {'GUI': "BOLD,ITALIC" , 'TERM': "NONE" }
  88. let s:vFg = {'GUI': s:gFg , 'TERM': s:tFg }
  89. let s:vBg = {'GUI': s:gBg , 'TERM': s:tBg }
  90. let s:vWhite = {'GUI': s:gWhite , 'TERM': s:tWhite }
  91. let s:vBlack = {'GUI': s:gBlack , 'TERM': s:tBlack }
  92. let s:vVeryLightGrey = {'GUI': s:gVeryLightGrey, 'TERM': s:tVeryLightGrey}
  93. let s:vLightGrey = {'GUI': s:gLightGrey , 'TERM': s:tLightGrey }
  94. let s:vGrey = {'GUI': s:gGrey , 'TERM': s:tGrey }
  95. let s:vDarkGrey = {'GUI': s:gDarkGrey , 'TERM': s:tDarkGrey }
  96. let s:vVeryDarkGrey = {'GUI': s:gVeryDarkGrey , 'TERM': s:tVeryDarkGrey }
  97. let s:vRed = {'GUI': s:gRed , 'TERM': s:tRed }
  98. let s:vOrange = {'GUI': s:gOrange , 'TERM': s:tOrange }
  99. let s:vYellow = {'GUI': s:gYellow , 'TERM': s:tYellow }
  100. let s:vGreen = {'GUI': s:gGreen , 'TERM': s:tGreen }
  101. let s:vBlue = {'GUI': s:gBlue , 'TERM': s:tBlue }
  102. " }}}
  103. " Highlight groups {{{
  104. " Basics
  105. call oldhope#SetHi ("Normal" , s:vFg , s:vBg , s:vNone )
  106. call oldhope#SetHi ("Underlined" , s:vFg , s:vBg , s:vUnderline )
  107. call oldhope#SetHi ("Comment" , s:vGrey , s:vBg , s:vNone )
  108. call oldhope#SetHi ("Todo" , s:vOrange , s:vBg , s:vNone )
  109. call oldhope#SetHi ("Ignore" , s:vGrey , s:vBg , s:vNone )
  110. " * Variable types
  111. call oldhope#SetHi ("Constant" , s:vOrange , s:vBg , s:vNone )
  112. call oldhope#LinkHi("Number" , "Constant")
  113. call oldhope#LinkHi("Float" , "Number")
  114. call oldhope#LinkHi("Boolean" , "Constant")
  115. call oldhope#SetHi ("String" , s:vBlue , s:vBg , s:vNone )
  116. call oldhope#LinkHi("Character" , "String")
  117. " * Keywords
  118. call oldhope#SetHi ("Statement" , s:vGreen , s:vBg , s:vNone )
  119. call oldhope#LinkHi("Conditional" , "Statement")
  120. call oldhope#LinkHi("Keyword" , "Statement")
  121. call oldhope#LinkHi("Repeat" , "Statement")
  122. call oldhope#LinkHi("Label" , "Statement")
  123. call oldhope#LinkHi("Operator" , "Statement")
  124. " * PreProcessor macros
  125. call oldhope#SetHi ("Define" , s:vGreen , s:vBg , s:vNone )
  126. call oldhope#LinkHi("Include" , "Define")
  127. call oldhope#LinkHi("Macro" , "Define")
  128. call oldhope#LinkHi("PreCondit" , "Define")
  129. call oldhope#LinkHi("PreProc" , "Define")
  130. " * Functions
  131. call oldhope#SetHi ("Identifier" , s:vYellow , s:vBg , s:vNone )
  132. call oldhope#LinkHi("Function" , "Identifier")
  133. " * Types
  134. call oldhope#SetHi ("Type" , s:vRed , s:vBg , s:vNone )
  135. call oldhope#LinkHi("Typedef" , "Type")
  136. call oldhope#LinkHi("Structure" , "Type")
  137. call oldhope#LinkHi("StorageClass" , "Type")
  138. " * Specials
  139. call oldhope#SetHi ("Special" , s:vBlue , s:vBg , s:vNone )
  140. call oldhope#LinkHi("SpecialChar" , "Special")
  141. call oldhope#LinkHi("Tag" , "Special")
  142. call oldhope#LinkHi("Delimiter" , "Special")
  143. call oldhope#LinkHi("SpecialComment", "Special")
  144. call oldhope#LinkHi("SpecialKey" , "Special")
  145. call oldhope#LinkHi("Debug" , "Special")
  146. " * Cursor
  147. call oldhope#SetHi ("Cursor" , s:vBg , s:vFg , s:vNone )
  148. call oldhope#LinkHi("iCursor" , "Cursor")
  149. call oldhope#LinkHi("vCursor" , "Cursor")
  150. call oldhope#LinkHi("lCursor" , "Cursor")
  151. " * Diff
  152. call oldhope#SetHi ("DiffAdd" , s:vVeryDarkGrey , s:vGreen , s:vNone )
  153. call oldhope#SetHi ("DiffChange" , s:vVeryDarkGrey , s:vYellow , s:vNone )
  154. call oldhope#SetHi ("DiffDelete" , s:vVeryDarkGrey , s:vRed , s:vNone )
  155. call oldhope#SetHi ("DiffText" , s:vNone , s:vGrey , s:vNone )
  156. " * Errors
  157. call oldhope#SetHi ("Error" , s:vVeryDarkGrey , s:vRed , s:vBold )
  158. call oldhope#SetHi ("ErrorMsg" , s:vVeryDarkGrey , s:vRed , s:vNone )
  159. call oldhope#SetHi ("Exception" , s:vYellow , s:vBg , s:vBold )
  160. " * Folding
  161. call oldhope#SetHi ("Folded" , s:vLightGrey , s:vDarkGrey , s:vNone )
  162. call oldhope#LinkHi("FoldColumn" , "Folded")
  163. " * Searching
  164. call oldhope#SetHi ("IncSearch" , s:vVeryDarkGrey , s:vVeryLightGrey, s:vNone )
  165. call oldhope#SetHi ("Search" , s:vVeryDarkGrey , s:vOrange , s:vNone )
  166. " * Other
  167. call oldhope#SetHi ("MatchParen" , s:vVeryDarkGrey , s:vYellow , s:vBold )
  168. call oldhope#SetHi ("ModeMsg" , s:vOrange , s:vBg , s:vNone )
  169. call oldhope#SetHi ("Question" , s:vOrange , s:vBg , s:vNone )
  170. " * Complete menu
  171. call oldhope#SetHi ("Pmenu" , s:vWhite , s:vDarkGrey , s:vNone )
  172. call oldhope#SetHi ("PmenuSel" , s:vVeryDarkGrey , s:vGreen , s:vBold )
  173. call oldhope#SetHi ("PmenuSbar" , s:vVeryDarkGrey , s:vVeryDarkGrey , s:vNone )
  174. call oldhope#SetHi ("PmenuSbar" , s:vGreen , s:vVeryDarkGrey , s:vNone )
  175. " * Marks
  176. call oldhope#SetHi ("SignColumn" , s:vFg , s:vBg , s:vNone )
  177. " GUI
  178. call oldhope#SetHi ("StatusLine" , s:vFg , s:vBg , s:vBold )
  179. call oldhope#SetHi ("StatusLineNC" , s:vGrey , s:vBg , s:vBold )
  180. call oldhope#SetHi ("Title" , s:vOrange , s:vNone , s:vNone )
  181. call oldhope#SetHi ("VertSplit" , s:vRed , s:vBg , s:vBold )
  182. call oldhope#SetHi ("VisualNOS" , s:vNone , s:vDarkGrey , s:vNone )
  183. call oldhope#SetHi ("Visual" , s:vNone , s:vDarkGrey , s:vNone )
  184. call oldhope#SetHi ("WarningMsg" , s:vOrange , s:vBg , s:vNone )
  185. call oldhope#SetHi ("WildMenu" , s:vBlue , s:vBg , s:vNone )
  186. call oldhope#SetHi ("Directory" , s:vGreen , s:vBg , s:vBold )
  187. call oldhope#SetHi ("TabLineFill" , s:vVeryDarkGrey , s:vBg , s:vNone )
  188. call oldhope#SetHi ("TabLineSel" , s:vLightGrey , s:vBg , s:vNone )
  189. call oldhope#SetHi ("TabLine" , s:vGrey , s:vBg , s:vNone )
  190. call oldhope#SetHi ("CursorLineNr" , s:vBlack , s:vRed , s:vBold )
  191. call oldhope#SetHi ("CursorLine" , s:vNone , s:vVeryDarkGrey , s:vNone )
  192. call oldhope#SetHi ("CursorColumn" , s:vNone , s:vVeryDarkGrey , s:vNone )
  193. call oldhope#SetHi ("ColorColumn" , s:vNone , s:vVeryDarkGrey , s:vNone )
  194. call oldhope#SetHi ("LineNr" , s:vGrey , s:vBg , s:vNone )
  195. call oldhope#SetHi ("NonText" , s:vRed , s:vBg , s:vNone )
  196. " User colors for status line
  197. call oldhope#SetHi ("User1" , s:vBlack , s:vRed , s:vBold )
  198. call oldhope#SetHi ("User2" , s:vRed , s:vBg , s:vBold )
  199. call oldhope#SetHi ("User3" , s:vFg , s:vBg , s:vBold )
  200. " Force dark background
  201. set background=dark