vim.lua 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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('Substitute', { link = 'Search' })
  56. hi('Whitespace', { link = 'NonText' })
  57. hi('MsgSeparator', { link = 'StatusLine' })
  58. hi('NormalFloat', { link = 'Pmenu' })
  59. hi('FloatBorder', { link = 'WinSeparator' })
  60. hi('FloatTitle', { link = 'Title' })
  61. hi('FloatFooter', { link = 'Title' })
  62. hi('FloatShadow', { bg = 'Black', blend=80 })
  63. hi('FloatShadowThrough', { bg = 'Black', blend=100 })
  64. hi('RedrawDebugNormal', { reverse = true, cterm = { reverse = true } })
  65. hi('RedrawDebugClear', { bg = 'Yellow', ctermbg = 'Yellow' })
  66. hi('RedrawDebugComposed', { bg = 'Green', ctermbg = 'Green' })
  67. hi('RedrawDebugRecompose', { bg = 'Red', ctermbg = 'Red' })
  68. hi('Error', { fg = 'White', bg = 'Red', ctermfg = 'White', ctermbg = 'Red' })
  69. hi('Todo', { fg = 'Blue', bg = 'Yellow', ctermfg = 'Black', ctermbg = 'Yellow' })
  70. hi('String', { link = 'Constant' })
  71. hi('Character', { link = 'Constant' })
  72. hi('Number', { link = 'Constant' })
  73. hi('Boolean', { link = 'Constant' })
  74. hi('Float', { link = 'Number' })
  75. hi('Function', { link = 'Identifier' })
  76. hi('Conditional', { link = 'Statement' })
  77. hi('Repeat', { link = 'Statement' })
  78. hi('Label', { link = 'Statement' })
  79. hi('Operator', { link = 'Statement' })
  80. hi('Keyword', { link = 'Statement' })
  81. hi('Exception', { link = 'Statement' })
  82. hi('Include', { link = 'PreProc' })
  83. hi('Define', { link = 'PreProc' })
  84. hi('Macro', { link = 'PreProc' })
  85. hi('PreCondit', { link = 'PreProc' })
  86. hi('StorageClass', { link = 'Type' })
  87. hi('Structure', { link = 'Type' })
  88. hi('Typedef', { link = 'Type' })
  89. hi('Tag', { link = 'Special' })
  90. hi('SpecialChar', { link = 'Special' })
  91. hi('Delimiter', { link = 'Special' })
  92. hi('SpecialComment', { link = 'Special' })
  93. hi('Debug', { link = 'Special' })
  94. hi('DiagnosticError', { fg = 'Red', ctermfg = 1 })
  95. hi('DiagnosticWarn', { fg = 'Orange', ctermfg = 3 })
  96. hi('DiagnosticInfo', { fg = 'LightBlue', ctermfg = 4 })
  97. hi('DiagnosticHint', { fg = 'LightGrey', ctermfg = 7 })
  98. hi('DiagnosticOk', { fg = 'LightGreen', ctermfg = 10 })
  99. hi('DiagnosticUnderlineError', { sp = 'Red', underline = true, cterm = { underline = true } })
  100. hi('DiagnosticUnderlineWarn', { sp = 'Orange', underline = true, cterm = { underline = true } })
  101. hi('DiagnosticUnderlineInfo', { sp = 'LightBlue', underline = true, cterm = { underline = true } })
  102. hi('DiagnosticUnderlineHint', { sp = 'LightGrey', underline = true, cterm = { underline = true } })
  103. hi('DiagnosticUnderlineOk', { sp = 'LightGreen', underline = true, cterm = { underline = true } })
  104. hi('DiagnosticVirtualTextError', { link = 'DiagnosticError' })
  105. hi('DiagnosticVirtualTextWarn', { link = 'DiagnosticWarn' })
  106. hi('DiagnosticVirtualTextInfo', { link = 'DiagnosticInfo' })
  107. hi('DiagnosticVirtualTextHint', { link = 'DiagnosticHint' })
  108. hi('DiagnosticVirtualTextOk', { link = 'DiagnosticOk' })
  109. hi('DiagnosticFloatingError', { link = 'DiagnosticError' })
  110. hi('DiagnosticFloatingWarn', { link = 'DiagnosticWarn' })
  111. hi('DiagnosticFloatingInfo', { link = 'DiagnosticInfo' })
  112. hi('DiagnosticFloatingHint', { link = 'DiagnosticHint' })
  113. hi('DiagnosticFloatingOk', { link = 'DiagnosticOk' })
  114. hi('DiagnosticSignError', { link = 'DiagnosticError' })
  115. hi('DiagnosticSignWarn', { link = 'DiagnosticWarn' })
  116. hi('DiagnosticSignInfo', { link = 'DiagnosticInfo' })
  117. hi('DiagnosticSignHint', { link = 'DiagnosticHint' })
  118. hi('DiagnosticSignOk', { link = 'DiagnosticOk' })
  119. hi('DiagnosticDeprecated', { sp = 'Red', strikethrough = true, cterm = { strikethrough = true } })
  120. hi('DiagnosticUnnecessary', { link = 'Comment' })
  121. hi('LspInlayHint', { link = 'NonText' })
  122. hi('SnippetTabstop', { link = 'Visual' })
  123. -- Text
  124. hi('@markup.raw', { link = 'Comment' })
  125. hi('@markup.link', { link = 'Identifier' })
  126. hi('@markup.heading', { link = 'Title' })
  127. hi('@markup.link.url', { link = 'Underlined' })
  128. hi('@markup.underline', { link = 'Underlined' })
  129. hi('@comment.todo', { link = 'Todo' })
  130. -- Miscs
  131. hi('@comment', { link = 'Comment' })
  132. hi('@punctuation', { link = 'Delimiter' })
  133. -- Constants
  134. hi('@constant', { link = 'Constant' })
  135. hi('@constant.builtin', { link = 'Special' })
  136. hi('@constant.macro', { link = 'Define' })
  137. hi('@keyword.directive', { link = 'Define' })
  138. hi('@string', { link = 'String' })
  139. hi('@string.escape', { link = 'SpecialChar' })
  140. hi('@string.special', { link = 'SpecialChar' })
  141. hi('@character', { link = 'Character' })
  142. hi('@character.special', { link = 'SpecialChar' })
  143. hi('@number', { link = 'Number' })
  144. hi('@boolean', { link = 'Boolean' })
  145. hi('@number.float', { link = 'Float' })
  146. -- Functions
  147. hi('@function', { link = 'Function' })
  148. hi('@function.builtin', { link = 'Special' })
  149. hi('@function.macro', { link = 'Macro' })
  150. hi('@function.method', { link = 'Function' })
  151. hi('@variable.parameter', { link = 'Identifier' })
  152. hi('@variable.parameter.builtin', { link = 'Special' })
  153. hi('@variable.member', { link = 'Identifier' })
  154. hi('@property', { link = 'Identifier' })
  155. hi('@attribute', { link = 'Macro' })
  156. hi('@attribute.builtin', { link = 'Special' })
  157. hi('@constructor', { link = 'Special' })
  158. -- Keywords
  159. hi('@keyword.conditional', { link = 'Conditional' })
  160. hi('@keyword.repeat', { link = 'Repeat' })
  161. hi('@keyword.type', { link = 'Structure' })
  162. hi('@label', { link = 'Label' })
  163. hi('@operator', { link = 'Operator' })
  164. hi('@keyword', { link = 'Keyword' })
  165. hi('@keyword.exception', { link = 'Exception' })
  166. hi('@variable', { link = 'Identifier' })
  167. hi('@type', { link = 'Type' })
  168. hi('@type.definition', { link = 'Typedef' })
  169. hi('@module', { link = 'Identifier' })
  170. hi('@keyword.import', { link = 'Include' })
  171. hi('@keyword.directive', { link = 'PreProc' })
  172. hi('@keyword.debug', { link = 'Debug' })
  173. hi('@tag', { link = 'Tag' })
  174. hi('@tag.builtin', { link = 'Special' })
  175. -- LSP semantic tokens
  176. hi('@lsp.type.class', { link = 'Structure' })
  177. hi('@lsp.type.comment', { link = 'Comment' })
  178. hi('@lsp.type.decorator', { link = 'Function' })
  179. hi('@lsp.type.enum', { link = 'Structure' })
  180. hi('@lsp.type.enumMember', { link = 'Constant' })
  181. hi('@lsp.type.function', { link = 'Function' })
  182. hi('@lsp.type.interface', { link = 'Structure' })
  183. hi('@lsp.type.macro', { link = 'Macro' })
  184. hi('@lsp.type.method', { link = 'Function' })
  185. hi('@lsp.type.namespace', { link = 'Structure' })
  186. hi('@lsp.type.parameter', { link = 'Identifier' })
  187. hi('@lsp.type.property', { link = 'Identifier' })
  188. hi('@lsp.type.struct', { link = 'Structure' })
  189. hi('@lsp.type.type', { link = 'Type' })
  190. hi('@lsp.type.typeParameter', { link = 'TypeDef' })
  191. hi('@lsp.type.variable', { link = 'Identifier' })
  192. if vim.o.background == 'light' then
  193. -- Default colors only used with a light background.
  194. hi('ColorColumn', { bg = 'LightRed', ctermbg = 'LightRed' })
  195. hi('CursorColumn', { bg = 'Grey90', ctermbg = 'LightGrey' })
  196. hi('CursorLine', { bg = 'Grey90', cterm = { underline = true } })
  197. hi('CursorLineNr', { fg = 'Brown', bold = true, ctermfg = 'Brown', cterm = { underline = true } })
  198. hi('DiffAdd', { bg = 'LightBlue', ctermbg = 'LightBlue' })
  199. hi('DiffChange', { bg = 'LightMagenta', ctermbg = 'LightMagenta' })
  200. hi('DiffDelete', { fg = 'Blue', bg = 'LightCyan', bold = true, ctermfg = 'Blue', ctermbg = 'LightCyan' })
  201. hi('Directory', { fg = 'Blue', ctermfg = 'DarkBlue' })
  202. hi('FoldColumn', { fg = 'DarkBlue', bg = 'Grey', ctermfg = 'DarkBlue', ctermbg = 'Grey' })
  203. hi('Folded', { fg = 'DarkBlue', bg = 'LightGrey', ctermfg = 'DarkBlue', ctermbg = 'Grey' })
  204. hi('LineNr', { fg = 'Brown', ctermfg = 'Brown' })
  205. hi('MatchParen', { bg = 'Cyan', ctermbg = 'Cyan' })
  206. hi('MoreMsg', { fg = 'SeaGreen', bold = true, ctermfg = 'DarkGreen' })
  207. hi('Pmenu', { bg = 'LightMagenta', ctermfg = 'Black', ctermbg = 'LightMagenta' })
  208. hi('PmenuSel', { bg = 'Grey', ctermfg = 'Black', ctermbg = 'LightGrey' })
  209. hi('PmenuThumb', { bg = 'Black', ctermbg = 'Black' })
  210. hi('Question', { fg = 'SeaGreen', bold = true, ctermfg = 'DarkGreen' })
  211. hi('Search', { bg = 'Yellow', ctermbg = 'Yellow' })
  212. hi('SignColumn', { fg = 'DarkBlue', bg = 'Grey', ctermfg = 'DarkBlue', ctermbg = 'Grey' })
  213. hi('SpecialKey', { fg = 'Blue', ctermfg = 'DarkBlue' })
  214. hi('SpellBad', { sp = 'Red', undercurl = true, ctermbg = 'LightRed' })
  215. hi('SpellCap', { sp = 'Blue', undercurl = true, ctermbg = 'LightBlue' })
  216. hi('SpellLocal', { sp = 'DarkCyan', undercurl = true, ctermbg = 'Cyan' })
  217. hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'LightMagenta' })
  218. hi('StatusLineTerm', { fg = 'White', bg = 'DarkGreen', bold = true, ctermfg = 'White', ctermbg = 'DarkGreen', cterm = { bold = true } })
  219. hi('StatusLineTermNC', { fg = 'White', bg = 'DarkGreen', ctermfg = 'White', ctermbg = 'DarkGreen' })
  220. hi('TabLine', { bg = 'LightGrey', underline = true, ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } })
  221. hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'DarkMagenta' })
  222. hi('Visual', { fg = 'Black', bg = 'LightGrey', ctermfg = 'Black', ctermbg = 'Grey' })
  223. hi('WarningMsg', { fg = 'Red', ctermfg = 'DarkRed' })
  224. hi('Comment', { fg = 'Blue', ctermfg = 'DarkBlue' })
  225. hi('Constant', { fg = 'Magenta', ctermfg = 'DarkRed' })
  226. hi('Special', { fg = '#6a5acd', ctermfg = 'DarkMagenta' })
  227. hi('Identifier', { fg = 'DarkCyan', ctermfg = 'DarkCyan' })
  228. hi('Statement', { fg = 'Brown', bold = true, ctermfg = 'Brown' })
  229. hi('PreProc', { fg = '#6a0dad', ctermfg = 'DarkMagenta' })
  230. hi('Type', { fg = 'SeaGreen', bold = true, ctermfg = 'DarkGreen' })
  231. hi('Underlined', { fg = 'SlateBlue', underline = true, ctermfg = 'DarkMagenta', cterm = { underline = true } })
  232. hi('Ignore', { ctermfg = 'White' })
  233. else
  234. -- Default colors only used with a dark background.
  235. hi('ColorColumn', { bg = 'DarkRed', ctermbg = 'DarkRed' })
  236. hi('CursorColumn', { bg = 'Grey40', ctermbg = 'DarkGrey' })
  237. hi('CursorLine', { bg = 'Grey40', cterm = { underline = true } })
  238. hi('CursorLineNr', { fg = 'Yellow', bold = true, ctermfg = 'Yellow', cterm = { underline = true } })
  239. hi('DiffAdd', { bg = 'DarkBlue', ctermbg = 'DarkBlue' })
  240. hi('DiffChange', { bg = 'DarkMagenta', ctermbg = 'DarkMagenta' })
  241. hi('DiffDelete', { fg = 'Blue', bg = 'DarkCyan', bold = true, ctermfg = 'Blue', ctermbg = 'DarkCyan' })
  242. hi('Directory', { fg = 'Cyan', ctermfg = 'LightCyan' })
  243. hi('FoldColumn', { fg = 'Cyan', bg = 'Grey', ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
  244. hi('Folded', { fg = 'Cyan', bg = 'DarkGrey', ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
  245. hi('LineNr', { fg = 'Yellow', ctermfg = 'Yellow' })
  246. hi('MatchParen', { bg = 'DarkCyan', ctermbg = 'DarkCyan' })
  247. hi('MoreMsg', { fg = 'SeaGreen', bold = true, ctermfg = 'LightGreen' })
  248. hi('Pmenu', { bg = 'Magenta', ctermfg = 'Black', ctermbg = 'Magenta' })
  249. hi('PmenuSel', { bg = 'DarkGrey', ctermfg = 'DarkGrey', ctermbg = 'Black' })
  250. hi('PmenuThumb', { bg = 'White', ctermbg = 'White' })
  251. hi('Question', { fg = 'Green', bold = true, ctermfg = 'LightGreen' })
  252. hi('Search', { fg = 'Black', bg = 'Yellow', ctermfg = 'Black', ctermbg = 'Yellow' })
  253. hi('SignColumn', { fg = 'Cyan', bg = 'Grey', ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
  254. hi('SpecialKey', { fg = 'Cyan', ctermfg = 'LightBlue' })
  255. hi('SpellBad', { sp = 'Red', undercurl = true, ctermbg = 'Red' })
  256. hi('SpellCap', { sp = 'Blue', undercurl = true, ctermbg = 'Blue' })
  257. hi('SpellLocal', { sp = 'Cyan', undercurl = true, ctermbg = 'Cyan' })
  258. hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'Magenta' })
  259. hi('StatusLineTerm', { fg = 'Black', bg = 'LightGreen', bold = true, ctermfg = 'Black', ctermbg = 'LightGreen', cterm = { bold = true } })
  260. hi('StatusLineTermNC', { fg = 'Black', bg = 'LightGreen', ctermfg = 'Black', ctermbg = 'LightGreen' })
  261. hi('TabLine', { bg = 'DarkGrey', underline = true, ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } })
  262. hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'LightMagenta' })
  263. hi('Visual', { fg = 'LightGrey', bg = '#575757', ctermfg = 'Black', ctermbg = 'Grey' })
  264. hi('WarningMsg', { fg = 'Red', ctermfg = 'LightRed' })
  265. hi('Comment', { fg = '#80a0ff', ctermfg = 'Cyan' })
  266. hi('Constant', { fg = '#ffa0a0', ctermfg = 'Magenta' })
  267. hi('Special', { fg = 'Orange', ctermfg = 'LightRed' })
  268. hi('Identifier', { fg = '#40ffff', ctermfg = 'Cyan', cterm = { bold = true } })
  269. hi('Statement', { fg = '#ffff60', bold = true, ctermfg = 'Yellow' })
  270. hi('PreProc', { fg = '#ff80ff', ctermfg = 'LightBlue' })
  271. hi('Type', { fg = '#60ff60', bold = true, ctermfg = 'LightGreen' })
  272. hi('Underlined', { fg = '#80a0ff', underline = true, ctermfg = 'LightBlue', cterm = { underline = true } })
  273. hi('Ignore', { ctermfg = 'Black' })
  274. end
  275. --stylua: ignore end