From c1c25b4b7943fa2008c0cd9cec79f892a6066dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 20 May 2023 22:41:54 +0200 Subject: [PATCH] Fix syntax highlighting for treesitter --- .../material/lua/lush_theme/material.lua | 97 ++++++++++--------- 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/nvim/colorschemes/material/lua/lush_theme/material.lua b/nvim/colorschemes/material/lua/lush_theme/material.lua index 28901f7..81de2a9 100644 --- a/nvim/colorschemes/material/lua/lush_theme/material.lua +++ b/nvim/colorschemes/material/lua/lush_theme/material.lua @@ -4,7 +4,8 @@ local lush = require("lush") local hsl = lush.hsl local hsluv = lush.hsluv -local theme = lush(function() +local theme = lush(function(injected_functions) + local sym = injected_functions.sym return { SpecialKey { fg="#455a64", }, -- SpecialKey xxx ctermfg=237 guifg=#455A64 TermCursor { gui="reverse", }, -- TermCursor xxx cterm=reverse gui=reverse @@ -43,12 +44,10 @@ local theme = lush(function() VertSplit { fg="#455a64", }, -- VertSplit xxx ctermfg=236 guifg=#455A64 WinSeparator { VertSplit }, -- WinSeparator xxx links to VertSplit Title { fg="#f0c674", }, -- Title xxx ctermfg=221 guifg=#f0c674 - TSTitle { Title }, -- TSTitle xxx links to Title Visual { bg=hsl(210, 80, 40), fg=hsl(0, 0, 80)}, -- Visual xxx ctermbg=237 guibg=#455A64 TelescopeSelection { Visual }, -- TelescopeSelection xxx links to Visual TelescopePreviewLine { Visual }, -- TelescopePreviewLine xxx links to Visual WarningMsg { fg="#cc6666", }, -- WarningMsg xxx ctermfg=167 guifg=#cc6666 - TSDanger { WarningMsg }, -- TSDanger xxx links to WarningMsg WildMenu { bg="yellow", fg="black", }, -- WildMenu xxx ctermfg=0 ctermbg=11 guifg=Black guibg=Yellow Folded { bg="#1c1c1c", fg="#707880", }, -- Folded xxx ctermfg=243 ctermbg=234 guifg=#707880 guibg=#1c1c1c FoldColumn { bg="#1c1c1c", }, -- FoldColumn xxx ctermbg=234 guibg=#1c1c1c @@ -107,17 +106,12 @@ local theme = lush(function() LspErrorText { Error }, -- LspErrorText xxx links to Error pythonSpaceError { Error }, -- pythonSpaceError xxx links to Error Todo { fg="#d7ffaf", }, -- Todo xxx ctermfg=193 guifg=#d7ffaf - TSTodo { Todo }, -- TSTodo xxx links to Todo - TSWarning { Todo }, -- TSWarning xxx links to Todo LspWarningHighlight { Todo }, -- LspWarningHighlight xxx links to Todo LspWarningText { Todo }, -- LspWarningText xxx links to Todo pythonTodo { Todo }, -- pythonTodo xxx links to Todo String { fg=hsl(147, 40, 55), }, -- String xxx ctermfg=143 guifg=#b5bd68 NvimString { String }, -- NvimString xxx links to String diffAdded { String }, -- diffAdded xxx links to String - TSString { String }, -- TSString xxx links to String - TSStringRegex { String }, -- TSStringRegex xxx links to String - TSLiteral { String }, -- TSLiteral xxx links to String TelescopePreviewExecute { String }, -- TelescopePreviewExecute xxx links to String TelescopePreviewSize { String }, -- TelescopePreviewSize xxx links to String pythonQuotes { String }, -- pythonQuotes xxx links to String @@ -127,8 +121,6 @@ local theme = lush(function() Character { Constant }, -- Character xxx links to Constant Number { Constant }, -- Number xxx links to Constant Boolean { Constant }, -- Boolean xxx links to Constant - TSConstant { Constant }, -- TSConstant xxx links to Constant - TSTextReference { Constant }, -- TSTextReference xxx links to Constant TelescopeResultsConstant { Constant }, -- TelescopeResultsConstant xxx links to Constant TelescopePreviewPipe { Constant }, -- TelescopePreviewPipe xxx links to Constant TelescopePreviewCharDev { Constant }, -- TelescopePreviewCharDev xxx links to Constant @@ -137,20 +129,14 @@ local theme = lush(function() TelescopePreviewUser { Constant }, -- TelescopePreviewUser xxx links to Constant TelescopePreviewGroup { Constant }, -- TelescopePreviewGroup xxx links to Constant Function { fg=hsl(56, 90, 50), }, -- Function xxx ctermfg=221 guifg=#f0c674 - TSFunction { Function }, -- TSFunction xxx links to Function - TSMethod { Function }, -- TSMethod xxx links to Function TelescopeResultsClass { Function }, -- TelescopeResultsClass xxx links to Function TelescopeResultsField { Function }, -- TelescopeResultsField xxx links to Function TelescopeResultsFunction { Function }, -- TelescopeResultsFunction xxx links to Function pythonFunction { Function }, -- pythonFunction xxx links to Function pythonDecoratorName { Function }, -- pythonDecoratorName xxx links to Function pythonBuiltin { Function }, -- pythonBuiltin xxx links to Function - Identifier { fg=hsl(20, 60, 50), }, -- Identifier xxx ctermfg=167 guifg=#cc6666 + Identifier { Normal, }, -- Identifier xxx ctermfg=167 guifg=#cc6666 NvimIdentifier { Identifier }, -- NvimIdentifier xxx links to Identifier - TSParameter { Identifier }, -- TSParameter xxx links to Identifier - TSField { Identifier }, -- TSField xxx links to Identifier - TSProperty { Identifier }, -- TSProperty xxx links to Identifier - TSSymbol { Identifier }, -- TSSymbol xxx links to Identifier TelescopeMultiIcon { Identifier }, -- TelescopeMultiIcon xxx links to Identifier TelescopePromptPrefix { Identifier }, -- TelescopePromptPrefix xxx links to Identifier TelescopeResultsIdentifier { Identifier }, -- TelescopeResultsIdentifier xxx links to Identifier @@ -164,44 +150,31 @@ local theme = lush(function() TelescopePreviewWrite { Statement }, -- TelescopePreviewWrite xxx links to Statement pythonStatement { Statement }, -- pythonStatement xxx links to Statement pythonAsync { Statement }, -- pythonAsync xxx links to Statement - Operator { fg="#8abeb7", }, -- Operator xxx ctermfg=109 guifg=#8abeb7 - NvimAssignment { Operator }, -- NvimAssignment xxx links to Operator - NvimOperator { Operator }, -- NvimOperator xxx links to Operator - TSOperator { Operator }, -- TSOperator xxx links to Operator - TelescopeResultsOperator { Operator }, -- TelescopeResultsOperator xxx links to Operator - pythonOperator { Operator }, -- pythonOperator xxx links to Operator PreProc { fg="#8abeb7", }, -- PreProc xxx ctermfg=109 guifg=#8abeb7 Include { PreProc }, -- Include xxx links to PreProc Define { PreProc }, -- Define xxx links to PreProc Macro { PreProc }, -- Macro xxx links to PreProc PreCondit { PreProc }, -- PreCondit xxx links to PreProc - TSAnnotation { PreProc }, -- TSAnnotation xxx links to PreProc - TSAttribute { PreProc }, -- TSAttribute xxx links to PreProc - TSPreProc { PreProc }, -- TSPreProc xxx links to PreProc - Type { fg="#de935f", }, -- Type xxx ctermfg=173 guifg=#de935f + Type { fg="#de935f", }, -- Type xxx ctermfg=173 guifg=#de935f StorageClass { Type }, -- StorageClass xxx links to Type Typedef { Type }, -- Typedef xxx links to Type NvimNumberPrefix { Type }, -- NvimNumberPrefix xxx links to Type NvimOptionSigil { Type }, -- NvimOptionSigil xxx links to Type - TSType { Type }, -- TSType xxx links to Type - TSTypeBuiltin { Type }, -- TSTypeBuiltin xxx links to Type - TSTypeQualifier { Type }, -- TSTypeQualifier xxx links to Type - TSEnvironmentName { Type }, -- TSEnvironmentName xxx links to Type TelescopeMultiSelection { Type }, -- TelescopeMultiSelection xxx links to Type - Structure { fg="#8abeb7", }, -- Structure xxx ctermfg=109 guifg=#8abeb7 + Structure { Type }, -- Structure xxx ctermfg=109 guifg=#8abeb7 pythonExceptions { Structure }, -- pythonExceptions xxx links to Structure Special { fg="#cc6666", }, -- Special xxx ctermfg=167 guifg=#cc6666 + Operator { Special }, -- Operator xxx ctermfg=109 guifg=#8abeb7 + NvimAssignment { Operator }, -- NvimAssignment xxx links to Operator + NvimOperator { Operator }, -- NvimOperator xxx links to Operator + TelescopeResultsOperator { Operator }, -- TelescopeResultsOperator xxx links to Operator + pythonOperator { Operator }, -- pythonOperator xxx links to Operator Tag { Special }, -- Tag xxx links to Special SpecialChar { Special }, -- SpecialChar xxx links to Special - Delimiter { Special }, -- Delimiter xxx links to Special + Delimiter { Normal }, -- Delimiter xxx links to Special SpecialComment { Special }, -- SpecialComment xxx links to Special Debug { Special }, -- Debug xxx links to Special diffRemoved { Special }, -- diffRemoved xxx links to Special - TSConstBuiltin { Special }, -- TSConstBuiltin xxx links to Special - TSFuncBuiltin { Special }, -- TSFuncBuiltin xxx links to Special - TSConstructor { Special }, -- TSConstructor xxx links to Special - TSVariableBuiltin { Special }, -- TSVariableBuiltin xxx links to Special - TSMath { Special }, -- TSMath xxx links to Special TelescopeMatching { Statement }, -- TelescopeMatching xxx links to Special TelescopePreviewLink { Special }, -- TelescopePreviewLink xxx links to Special pythonEscape { Special }, -- pythonEscape xxx links to Special @@ -232,13 +205,11 @@ local theme = lush(function() DiagnosticUnderlineHint { gui="underline", sp="lightgrey", }, -- DiagnosticUnderlineHint xxx cterm=underline gui=underline guisp=LightGrey MatchParen { bg="#5f5f87", fg="#8abeb7", }, -- MatchParen xxx ctermfg=109 ctermbg=60 guifg=#8abeb7 guibg=#5F5F87 Comment { fg="#707880", }, -- Comment xxx ctermfg=243 guifg=#707880 - TSComment { Comment }, -- TSComment xxx links to Comment TelescopeResultsComment { Comment }, -- TelescopeResultsComment xxx links to Comment TroubleSource { Comment }, -- TroubleSource xxx links to Comment TroubleCode { Comment }, -- TroubleCode xxx links to Comment pythonComment { Comment }, -- pythonComment xxx links to Comment Underlined { fg="#81a2be", }, -- Underlined xxx ctermfg=110 guifg=#81a2be - TSURI { Underlined }, -- TSURI xxx links to Underlined NvimInternalError { bg="red", fg="red", }, -- NvimInternalError xxx ctermfg=9 ctermbg=9 guifg=Red guibg=Red NvimFigureBrace { NvimInternalError }, -- NvimFigureBrace xxx links to NvimInternalError NvimSingleQuotedUnknownEscape { NvimInternalError }, -- NvimSingleQuotedUnknownEscape xxx links to NvimInternalError @@ -318,12 +289,6 @@ local theme = lush(function() CmpItemKind { CmpItemKindDefault }, -- CmpItemKind xxx links to CmpItemKindDefault CmpItemMenuDefault { fg="#c5c8c6", }, -- CmpItemMenuDefault xxx cterm= gui= guifg=#c5c8c6 CmpItemMenu { CmpItemMenuDefault }, -- CmpItemMenu xxx links to CmpItemMenuDefault - TSNone { }, -- TSNone xxx cterm= gui= - TSText { TSNone }, -- TSText xxx links to TSNone - TSStrong { gui="bold", }, -- TSStrong xxx cterm=bold gui=bold - TSEmphasis { gui="italic", }, -- TSEmphasis xxx cterm=italic gui=italic - TSUnderline { gui="underline", }, -- TSUnderline xxx cterm=underline gui=underline - TSStrike { gui="strikethrough", }, -- TSStrike xxx cterm=strikethrough gui=strikethrough lualine_transitional_lualine_a_normal_to_lualine_c_normal { bg="#2c3043", fg="#82aaff", }, -- lualine_transitional_lualine_a_normal_to_lualine_c_normal xxx guifg=#82aaff guibg=#2c3043 lualine_transitional_lualine_a_normal_to_lualine_b_normal { bg="#2c3043", fg="#82aaff", }, -- lualine_transitional_lualine_a_normal_to_lualine_b_normal xxx guifg=#82aaff guibg=#2c3043 DevIconKotlinScript { fg="#f88a02", }, -- DevIconKotlinScript xxx ctermfg=208 guifg=#F88A02 @@ -535,6 +500,46 @@ local theme = lush(function() lualine_x_filetype_DevIconPy_terminal { bg="#2c3043", fg="#ffbc03", }, -- lualine_x_filetype_DevIconPy_terminal xxx guifg=#ffbc03 guibg=#2c3043 lualine_x_filetype_DevIconPy_inactive { bg="#2c3043", fg="#ffbc03", }, -- lualine_x_filetype_DevIconPy_inactive xxx guifg=#ffbc03 guibg=#2c3043 lualine_transitional_lualine_a_normal_to_lualine_b_diagnostics_hint_command { bg="#2c3043", fg="#82aaff", }, -- lualine_transitional_lualine_a_normal_to_lualine_b_diagnostics_hint_command xxx guifg=#82aaff guibg=#2c3043 + sym"@text.title" { Title }, -- @text.title xxx links to Title + sym"@text.todo" { Todo }, -- @text.todo xxx links to Todo + sym"@string" { String }, -- @string xxx links to String + sym"@constant" { Constant }, -- @constant xxx links to Constant + sym"@lsp.type.enumMember" { Constant }, -- @lsp.type.enumMember xxx links to Constant + sym"@function" { Function }, -- @function xxx links to Function + sym"@method" { Function }, -- @method xxx links to Function + sym"@lsp.type.decorator" { Function }, -- @lsp.type.decorator xxx links to Function + sym"@lsp.type.function" { Function }, -- @lsp.type.function xxx links to Function + sym"@lsp.type.method" { Function }, -- @lsp.type.method xxx links to Function + sym"@text.reference" { Identifier }, -- @text.reference xxx links to Identifier + sym"@parameter" { Identifier }, -- @parameter xxx links to Identifier + sym"@field" { Identifier }, -- @field xxx links to Identifier + sym"@property" { Identifier }, -- @property xxx links to Identifier + sym"@variable" { Identifier }, -- @variable xxx links to Identifier + sym"@namespace" { Identifier }, -- @namespace xxx links to Identifier + sym"@lsp.type.parameter" { Identifier }, -- @lsp.type.parameter xxx links to Identifier + sym"@lsp.type.property" { Identifier }, -- @lsp.type.property xxx links to Identifier + sym"@lsp.type.variable" { Identifier }, -- @lsp.type.variable xxx links to Identifier + sym"@symbol" { Identifier }, -- TSSymbol xxx links to Identifier + sym"@operator" { Operator }, -- @operator xxx links to Operator + sym"@preproc" { PreProc }, -- @preproc xxx links to PreProc + sym"@type" { Structure }, -- @type xxx links to Type + sym"@lsp.type.type" { Structure }, -- @lsp.type.type xxx links to Type + sym"@lsp.type.class" { Structure }, -- @lsp.type.class xxx links to Structure + sym"@lsp.type.enum" { Structure }, -- @lsp.type.enum xxx links to Structure + sym"@lsp.type.interface" { Structure }, -- @lsp.type.interface xxx links to Structure + sym"@lsp.type.namespace" { Structure }, -- @lsp.type.namespace xxx links to Structure + sym"@lsp.type.struct" { Structure }, -- @lsp.type.struct xxx links to Structure + sym"@constant.builtin" { Special }, -- @constant.builtin xxx links to Special + sym"@function.builtin" { Function }, -- @function.builtin xxx links to Special + sym"@constructor" { Function }, -- @constructor xxx links to Special + sym"@text.literal" { Comment }, -- @text.literal xxx links to Comment + sym"@comment" { Comment }, -- @comment xxx links to Comment + sym"@lsp.type.comment" { Comment }, -- @lsp.type.comment xxx links to Comment + sym"@text.uri" { Underlined }, -- @text.uri xxx links to Underlined + sym"@text.underline" { Underlined }, -- @text.underline xxx links to Underlined + sym"@punctuation.delimiter" { Normal }, + sym"@puncuation.bracket" { Normal }, -- For brackets and parens. + sym"@puncuation.special" { Normal }, -- For special punctutation that does not fall in the catagories before. } end) return theme