vim.lua 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. -- Name: vim
  2. -- Description: Vim's default color scheme
  3. -- Author: Bram Moolenaar <Bram@vim.org>
  4. -- Maintainer: The Vim Project <https://github.com/vim/vim>
  5. -- Website: https://github.com/vim/vim
  6. -- License: Same as Vim
  7. -- Last Updated: 2023 Aug 10
  8. -- This is Vim's default color scheme. It doesn't define the Normal
  9. -- highlighting, it uses whatever the colors used to be.
  10. vim.cmd.highlight('clear')
  11. vim.g.colors_name = 'vim'
  12. local hi = function(name, val)
  13. -- Force links
  14. val.force = true
  15. -- Make sure that `cterm` attribute is not populated from `gui`
  16. val.cterm = val.cterm or {}
  17. -- Define global highlight
  18. vim.api.nvim_set_hl(0, name, val)
  19. end
  20. --stylua: ignore start
  21. -- General
  22. hi('Normal', {})
  23. hi('Conceal', { fg = 'LightGrey', bg = 'DarkGrey', ctermfg = 'LightGrey', ctermbg = 'DarkGrey' })
  24. hi('Cursor', {})
  25. hi('lCursor', {})
  26. hi('DiffText', { bg = 'Red', bold = true, ctermbg = 'Red', cterm = { bold = true } })
  27. hi('ErrorMsg', { fg = 'White', bg = 'Red', ctermfg = 'White', ctermbg = 'DarkRed' })
  28. hi('IncSearch', { reverse = true, cterm = { reverse = true } })
  29. hi('ModeMsg', { bold = true, cterm = { bold = true } })
  30. hi('NonText', { fg = 'Blue', bold = true, ctermfg = 'Blue' })
  31. hi('PmenuSbar', { bg = 'Grey', ctermbg = 'Grey' })
  32. hi('StatusLine', { reverse = true, bold = true, cterm = { reverse = true, bold = true }})
  33. hi('StatusLineNC', { reverse = true, cterm = { reverse = true } })
  34. hi('TabLineFill', { reverse = true, cterm = { reverse = true } })
  35. hi('TabLineSel', { bold = true, cterm = { bold = true } })
  36. hi('TermCursor', { reverse = true, cterm = { reverse = true } })
  37. hi('WinBar', { bold = true, cterm = { bold = true } })
  38. hi('WildMenu', { fg = 'Black', bg = 'Yellow', ctermfg = 'Black', ctermbg = 'Yellow' })
  39. hi('VertSplit', { link = 'Normal' })
  40. hi('WinSeparator', { link = 'VertSplit' })
  41. hi('WinBarNC', { link = 'WinBar' })
  42. hi('EndOfBuffer', { link = 'NonText' })
  43. hi('LineNrAbove', { link = 'LineNr' })
  44. hi('LineNrBelow', { link = 'LineNr' })
  45. hi('QuickFixLine', { link = 'Search' })
  46. hi('CursorLineSign', { link = 'SignColumn' })
  47. hi('CursorLineFold', { link = 'FoldColumn' })
  48. hi('CurSearch', { link = 'Search' })
  49. hi('PmenuKind', { link = 'Pmenu' })
  50. hi('PmenuKindSel', { link = 'PmenuSel' })
  51. hi('PmenuMatch', { link = 'Pmenu' })
  52. hi('PmenuMatchSel', { link = 'PmenuSel' })
  53. hi('PmenuExtra', { link = 'Pmenu' })
  54. hi('PmenuExtraSel', { link = 'PmenuSel' })
  55. hi('ComplMatchIns', {})
  56. hi('Substitute', { link = 'Search' })
  57. hi('Whitespace', { link = 'NonText' })
  58. hi('MsgSeparator', { link = 'StatusLine' })
  59. hi('NormalFloat', { link = 'Pmenu' })
  60. hi('FloatBorder', { link = 'WinSeparator' })
  61. hi('FloatTitle', { link = 'Title' })
  62. hi('FloatFooter', { link = 'Title' })
  63. hi('FloatShadow', { bg = 'Black', blend=80 })
  64. hi('FloatShadowThrough', { bg = 'Black', blend=100 })
  65. hi('RedrawDebugNormal', { reverse = true, cterm = { reverse = true } })
  66. hi('RedrawDebugClear', { bg = 'Yellow', ctermbg = 'Yellow' })
  67. hi('RedrawDebugComposed', { bg = 'Green', ctermbg = 'Green' })
  68. hi('RedrawDebugRecompose', { bg = 'Red', ctermbg = 'Red' })
  69. hi('Error', { fg = 'White', bg = 'Red', ctermfg = 'White', ctermbg = 'Red' })
  70. hi('Todo', { fg = 'Blue', bg = 'Yellow', ctermfg = 'Black', ctermbg = 'Yellow' })
  71. hi('String', { link = 'Constant' })
  72. hi('Character', { link = 'Constant' })
  73. hi('Number', { link = 'Constant' })
  74. hi('Boolean', { link = 'Constant' })
  75. hi('Float', { link = 'Number' })
  76. hi('Function', { link = 'Identifier' })
  77. hi('Conditional', { link = 'Statement' })
  78. hi('Repeat', { link = 'Statement' })
  79. hi('Label', { link = 'Statement' })
  80. hi('Operator', { link = 'Statement' })
  81. hi('Keyword', { link = 'Statement' })
  82. hi('Exception', { link = 'Statement' })
  83. hi('Include', { link = 'PreProc' })
  84. hi('Define', { link = 'PreProc' })
  85. hi('Macro', { link = 'PreProc' })
  86. hi('PreCondit', { link = 'PreProc' })
  87. hi('StorageClass', { link = 'Type' })
  88. hi('Structure', { link = 'Type' })
  89. hi('Typedef', { link = 'Type' })
  90. hi('Tag', { link = 'Special' })
  91. hi('SpecialChar', { link = 'Special' })
  92. hi('Delimiter', { link = 'Special' })
  93. hi('SpecialComment', { link = 'Special' })
  94. hi('Debug', { link = 'Special' })
  95. hi('DiagnosticError', { fg = 'Red', ctermfg = 1 })
  96. hi('DiagnosticWarn', { fg = 'Orange', ctermfg = 3 })
  97. hi('DiagnosticInfo', { fg = 'LightBlue', ctermfg = 4 })
  98. hi('DiagnosticHint', { fg = 'LightGrey', ctermfg = 7 })
  99. hi('DiagnosticOk', { fg = 'LightGreen', ctermfg = 10 })
  100. hi('DiagnosticUnderlineError', { sp = 'Red', underline = true, cterm = { underline = true } })
  101. hi('DiagnosticUnderlineWarn', { sp = 'Orange', underline = true, cterm = { underline = true } })
  102. hi('DiagnosticUnderlineInfo', { sp = 'LightBlue', underline = true, cterm = { underline = true } })
  103. hi('DiagnosticUnderlineHint', { sp = 'LightGrey', underline = true, cterm = { underline = true } })
  104. hi('DiagnosticUnderlineOk', { sp = 'LightGreen', underline = true, cterm = { underline = true } })
  105. hi('DiagnosticVirtualTextError', { link = 'DiagnosticError' })
  106. hi('DiagnosticVirtualTextWarn', { link = 'DiagnosticWarn' })
  107. hi('DiagnosticVirtualTextInfo', { link = 'DiagnosticInfo' })
  108. hi('DiagnosticVirtualTextHint', { link = 'DiagnosticHint' })
  109. hi('DiagnosticVirtualTextOk', { link = 'DiagnosticOk' })
  110. hi('DiagnosticFloatingError', { link = 'DiagnosticError' })
  111. hi('DiagnosticFloatingWarn', { link = 'DiagnosticWarn' })
  112. hi('DiagnosticFloatingInfo', { link = 'DiagnosticInfo' })
  113. hi('DiagnosticFloatingHint', { link = 'DiagnosticHint' })
  114. hi('DiagnosticFloatingOk', { link = 'DiagnosticOk' })
  115. hi('DiagnosticSignError', { link = 'DiagnosticError' })
  116. hi('DiagnosticSignWarn', { link = 'DiagnosticWarn' })
  117. hi('DiagnosticSignInfo', { link = 'DiagnosticInfo' })
  118. hi('DiagnosticSignHint', { link = 'DiagnosticHint' })
  119. hi('DiagnosticSignOk', { link = 'DiagnosticOk' })
  120. hi('DiagnosticDeprecated', { sp = 'Red', strikethrough = true, cterm = { strikethrough = true } })
  121. hi('DiagnosticUnnecessary', { link = 'Comment' })
  122. hi('LspInlayHint', { link = 'NonText' })
  123. hi('SnippetTabstop', { link = 'Visual' })
  124. -- Text
  125. hi('@markup.raw', { link = 'Comment' })
  126. hi('@markup.link', { link = 'Identifier' })
  127. hi('@markup.heading', { link = 'Title' })
  128. hi('@markup.link.url', { link = 'Underlined' })
  129. hi('@markup.underline', { link = 'Underlined' })
  130. hi('@comment.todo', { link = 'Todo' })
  131. -- Miscs
  132. hi('@comment', { link = 'Comment' })
  133. hi('@punctuation', { link = 'Delimiter' })
  134. -- Constants
  135. hi('@constant', { link = 'Constant' })
  136. hi('@constant.builtin', { link = 'Special' })
  137. hi('@constant.macro', { link = 'Define' })
  138. hi('@keyword.directive', { link = 'Define' })
  139. hi('@string', { link = 'String' })
  140. hi('@string.escape', { link = 'SpecialChar' })
  141. hi('@string.special', { link = 'SpecialChar' })
  142. hi('@character', { link = 'Character' })
  143. hi('@character.special', { link = 'SpecialChar' })
  144. hi('@number', { link = 'Number' })
  145. hi('@boolean', { link = 'Boolean' })
  146. hi('@number.float', { link = 'Float' })
  147. -- Functions
  148. hi('@function', { link = 'Function' })
  149. hi('@function.builtin', { link = 'Special' })
  150. hi('@function.macro', { link = 'Macro' })
  151. hi('@function.method', { link = 'Function' })
  152. hi('@variable.parameter', { link = 'Identifier' })
  153. hi('@variable.parameter.builtin', { link = 'Special' })
  154. hi('@variable.member', { link = 'Identifier' })
  155. hi('@property', { link = 'Identifier' })
  156. hi('@attribute', { link = 'Macro' })
  157. hi('@attribute.builtin', { link = 'Special' })
  158. hi('@constructor', { link = 'Special' })
  159. -- Keywords
  160. hi('@keyword.conditional', { link = 'Conditional' })
  161. hi('@keyword.repeat', { link = 'Repeat' })
  162. hi('@keyword.type', { link = 'Structure' })
  163. hi('@label', { link = 'Label' })
  164. hi('@operator', { link = 'Operator' })
  165. hi('@keyword', { link = 'Keyword' })
  166. hi('@keyword.exception', { link = 'Exception' })
  167. hi('@variable', { link = 'Identifier' })
  168. hi('@type', { link = 'Type' })
  169. hi('@type.definition', { link = 'Typedef' })
  170. hi('@module', { link = 'Identifier' })
  171. hi('@keyword.import', { link = 'Include' })
  172. hi('@keyword.directive', { link = 'PreProc' })
  173. hi('@keyword.debug', { link = 'Debug' })
  174. hi('@tag', { link = 'Tag' })
  175. hi('@tag.builtin', { link = 'Special' })
  176. -- LSP semantic tokens
  177. hi('@lsp.type.class', { link = 'Structure' })
  178. hi('@lsp.type.comment', { link = 'Comment' })
  179. hi('@lsp.type.decorator', { link = 'Function' })
  180. hi('@lsp.type.enum', { link = 'Structure' })
  181. hi('@lsp.type.enumMember', { link = 'Constant' })
  182. hi('@lsp.type.function', { link = 'Function' })
  183. hi('@lsp.type.interface', { link = 'Structure' })
  184. hi('@lsp.type.macro', { link = 'Macro' })
  185. hi('@lsp.type.method', { link = 'Function' })
  186. hi('@lsp.type.namespace', { link = 'Structure' })
  187. hi('@lsp.type.parameter', { link = 'Identifier' })
  188. hi('@lsp.type.property', { link = 'Identifier' })
  189. hi('@lsp.type.struct', { link = 'Structure' })
  190. hi('@lsp.type.type', { link = 'Type' })
  191. hi('@lsp.type.typeParameter', { link = 'TypeDef' })
  192. hi('@lsp.type.variable', { link = 'Identifier' })
  193. if vim.o.background == 'light' then
  194. -- Default colors only used with a light background.
  195. hi('ColorColumn', { bg = 'LightRed', ctermbg = 'LightRed' })
  196. hi('CursorColumn', { bg = 'Grey90', ctermbg = 'LightGrey' })
  197. hi('CursorLine', { bg = 'Grey90', cterm = { underline = true } })
  198. hi('CursorLineNr', { fg = 'Brown', bold = true, ctermfg = 'Brown', cterm = { underline = true } })
  199. hi('DiffAdd', { bg = 'LightBlue', ctermbg = 'LightBlue' })
  200. hi('DiffChange', { bg = 'LightMagenta', ctermbg = 'LightMagenta' })
  201. hi('DiffDelete', { fg = 'Blue', bg = 'LightCyan', bold = true, ctermfg = 'Blue', ctermbg = 'LightCyan' })
  202. hi('Directory', { fg = 'Blue', ctermfg = 'DarkBlue' })
  203. hi('FoldColumn', { fg = 'DarkBlue', bg = 'Grey', ctermfg = 'DarkBlue', ctermbg = 'Grey' })
  204. hi('Folded', { fg = 'DarkBlue', bg = 'LightGrey', ctermfg = 'DarkBlue', ctermbg = 'Grey' })
  205. hi('LineNr', { fg = 'Brown', ctermfg = 'Brown' })
  206. hi('MatchParen', { bg = 'Cyan', ctermbg = 'Cyan' })
  207. hi('MoreMsg', { fg = 'SeaGreen', bold = true, ctermfg = 'DarkGreen' })
  208. hi('Pmenu', { bg = 'LightMagenta', ctermfg = 'Black', ctermbg = 'LightMagenta' })
  209. hi('PmenuSel', { bg = 'Grey', ctermfg = 'Black', ctermbg = 'LightGrey' })
  210. hi('PmenuThumb', { bg = 'Black', ctermbg = 'Black' })
  211. hi('Question', { fg = 'SeaGreen', bold = true, ctermfg = 'DarkGreen' })
  212. hi('Search', { bg = 'Yellow', ctermbg = 'Yellow' })
  213. hi('SignColumn', { fg = 'DarkBlue', bg = 'Grey', ctermfg = 'DarkBlue', ctermbg = 'Grey' })
  214. hi('SpecialKey', { fg = 'Blue', ctermfg = 'DarkBlue' })
  215. hi('SpellBad', { sp = 'Red', undercurl = true, ctermbg = 'LightRed' })
  216. hi('SpellCap', { sp = 'Blue', undercurl = true, ctermbg = 'LightBlue' })
  217. hi('SpellLocal', { sp = 'DarkCyan', undercurl = true, ctermbg = 'Cyan' })
  218. hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'LightMagenta' })
  219. hi('StatusLineTerm', { fg = 'White', bg = 'DarkGreen', bold = true, ctermfg = 'White', ctermbg = 'DarkGreen', cterm = { bold = true } })
  220. hi('StatusLineTermNC', { fg = 'White', bg = 'DarkGreen', ctermfg = 'White', ctermbg = 'DarkGreen' })
  221. hi('TabLine', { bg = 'LightGrey', underline = true, ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } })
  222. hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'DarkMagenta' })
  223. hi('Visual', { fg = 'Black', bg = 'LightGrey', ctermfg = 'Black', ctermbg = 'Grey' })
  224. hi('WarningMsg', { fg = 'Red', ctermfg = 'DarkRed' })
  225. hi('Comment', { fg = 'Blue', ctermfg = 'DarkBlue' })
  226. hi('Constant', { fg = 'Magenta', ctermfg = 'DarkRed' })
  227. hi('Special', { fg = '#6a5acd', ctermfg = 'DarkMagenta' })
  228. hi('Identifier', { fg = 'DarkCyan', ctermfg = 'DarkCyan' })
  229. hi('Statement', { fg = 'Brown', bold = true, ctermfg = 'Brown' })
  230. hi('PreProc', { fg = '#6a0dad', ctermfg = 'DarkMagenta' })
  231. hi('Type', { fg = 'SeaGreen', bold = true, ctermfg = 'DarkGreen' })
  232. hi('Underlined', { fg = 'SlateBlue', underline = true, ctermfg = 'DarkMagenta', cterm = { underline = true } })
  233. hi('Ignore', { ctermfg = 'White' })
  234. else
  235. -- Default colors only used with a dark background.
  236. hi('ColorColumn', { bg = 'DarkRed', ctermbg = 'DarkRed' })
  237. hi('CursorColumn', { bg = 'Grey40', ctermbg = 'DarkGrey' })
  238. hi('CursorLine', { bg = 'Grey40', cterm = { underline = true } })
  239. hi('CursorLineNr', { fg = 'Yellow', bold = true, ctermfg = 'Yellow', cterm = { underline = true } })
  240. hi('DiffAdd', { bg = 'DarkBlue', ctermbg = 'DarkBlue' })
  241. hi('DiffChange', { bg = 'DarkMagenta', ctermbg = 'DarkMagenta' })
  242. hi('DiffDelete', { fg = 'Blue', bg = 'DarkCyan', bold = true, ctermfg = 'Blue', ctermbg = 'DarkCyan' })
  243. hi('Directory', { fg = 'Cyan', ctermfg = 'LightCyan' })
  244. hi('FoldColumn', { fg = 'Cyan', bg = 'Grey', ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
  245. hi('Folded', { fg = 'Cyan', bg = 'DarkGrey', ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
  246. hi('LineNr', { fg = 'Yellow', ctermfg = 'Yellow' })
  247. hi('MatchParen', { bg = 'DarkCyan', ctermbg = 'DarkCyan' })
  248. hi('MoreMsg', { fg = 'SeaGreen', bold = true, ctermfg = 'LightGreen' })
  249. hi('Pmenu', { bg = 'Magenta', ctermfg = 'Black', ctermbg = 'Magenta' })
  250. hi('PmenuSel', { bg = 'DarkGrey', ctermfg = 'DarkGrey', ctermbg = 'Black' })
  251. hi('PmenuThumb', { bg = 'White', ctermbg = 'White' })
  252. hi('Question', { fg = 'Green', bold = true, ctermfg = 'LightGreen' })
  253. hi('Search', { fg = 'Black', bg = 'Yellow', ctermfg = 'Black', ctermbg = 'Yellow' })
  254. hi('SignColumn', { fg = 'Cyan', bg = 'Grey', ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
  255. hi('SpecialKey', { fg = 'Cyan', ctermfg = 'LightBlue' })
  256. hi('SpellBad', { sp = 'Red', undercurl = true, ctermbg = 'Red' })
  257. hi('SpellCap', { sp = 'Blue', undercurl = true, ctermbg = 'Blue' })
  258. hi('SpellLocal', { sp = 'Cyan', undercurl = true, ctermbg = 'Cyan' })
  259. hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'Magenta' })
  260. hi('StatusLineTerm', { fg = 'Black', bg = 'LightGreen', bold = true, ctermfg = 'Black', ctermbg = 'LightGreen', cterm = { bold = true } })
  261. hi('StatusLineTermNC', { fg = 'Black', bg = 'LightGreen', ctermfg = 'Black', ctermbg = 'LightGreen' })
  262. hi('TabLine', { bg = 'DarkGrey', underline = true, ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } })
  263. hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'LightMagenta' })
  264. hi('Visual', { fg = 'LightGrey', bg = '#575757', ctermfg = 'Black', ctermbg = 'Grey' })
  265. hi('WarningMsg', { fg = 'Red', ctermfg = 'LightRed' })
  266. hi('Comment', { fg = '#80a0ff', ctermfg = 'Cyan' })
  267. hi('Constant', { fg = '#ffa0a0', ctermfg = 'Magenta' })
  268. hi('Special', { fg = 'Orange', ctermfg = 'LightRed' })
  269. hi('Identifier', { fg = '#40ffff', ctermfg = 'Cyan', cterm = { bold = true } })
  270. hi('Statement', { fg = '#ffff60', bold = true, ctermfg = 'Yellow' })
  271. hi('PreProc', { fg = '#ff80ff', ctermfg = 'LightBlue' })
  272. hi('Type', { fg = '#60ff60', bold = true, ctermfg = 'LightGreen' })
  273. hi('Underlined', { fg = '#80a0ff', underline = true, ctermfg = 'LightBlue', cterm = { underline = true } })
  274. hi('Ignore', { ctermfg = 'Black' })
  275. end
  276. --stylua: ignore end