diff --git a/lua/themer/modules/core/mapper.lua b/lua/themer/modules/core/mapper.lua index 40b8ca3..0fb8b62 100644 --- a/lua/themer/modules/core/mapper.lua +++ b/lua/themer/modules/core/mapper.lua @@ -322,60 +322,115 @@ local function get_base(cp) }, treesitter = { + -- ["@annotation"] = {}, -- TSAnnotation = {}, + -- ["@attribute"] = {}, -- TSAttribute = {}, + -- ["@boolean"] = { fg = cp.orange }, -- TSBoolean = { fg = cp.orange }, + -- ["@character"] = {}, -- TSCharacter = {}, + -- ["@comment"] = groups.styles.comment, -- TSComment = groups.styles.comment, + ["@note"] = { link = "DiagnosticInfo" }, TSNote = { link = "DiagnosticInfo" }, + ["@warning"] = { link = "DiagnosticWarn" }, TSWarning = { link = "DiagnosticWarn" }, + ["@danger"] = { link = "DiagnosticError" }, TSDanger = { link = "DiagnosticError" }, + ["@conditional"] = { link = "ThemerConditional" }, TSConditional = { link = "ThemerConditional" }, + ["@constant.builtin"] = { link = "ThemerConstantBuiltIn" }, TSConstBuiltin = { link = "ThemerConstantBuiltIn" }, + -- ["@constant.macro"] = {}, -- TSConstMacro = {}, + ["@constant"] = { link = "ThemerConstant" }, TSConstant = { link = "ThemerConstant" }, + ["@constructor"] = { link = "ThemerConstructor" }, TSConstructor = { link = "ThemerConstructor" }, + -- ["@text.emphasis"] = {}, -- TSEmphasis = {}, + -- ["@error"] = {}, -- TSError = {}, + -- ["@exception"] = {}, -- TSException = {}, + ["@field"] = { link = "ThemerField" }, TSField = { link = "ThemerField" }, + -- ["@float"] = {}, -- TSFloat = {}, + ["@function.builtin"] = { link = "ThemerFunctionBuiltIn" }, TSFuncBuiltin = { link = "ThemerFunctionBuiltIn" }, + -- ["@function.macro"] = {}, -- TSFuncMacro = {}, + ["@function"] = { link = "ThemerFunction" }, TSFunction = { link = "ThemerFunction" }, + ["@include"] = { link = "ThemerInclude" }, TSInclude = { link = "ThemerInclude" }, + ["@keyword"] = { link = "ThemerKeyword" }, TSKeyword = { link = "ThemerKeyword" }, + ["@keyword.function"] = { link = "ThemerKeywordBuiltIn" }, TSKeywordFunction = { link = "ThemerKeywordBuiltIn" }, + ["@keyword.return"] = { link = "ThemerKeywordBuiltIn" }, TSKeywordReturn = { link = "ThemerKeywordBuiltIn" }, + ["@keyword.operator"] = { link = "ThemerOperator" }, TSKeywordOperator = { link = "ThemerOperator" }, + -- ["@label"] = {}, -- TSLabel = {}, + -- ["@text.literal"] = {}, -- TSLiteral = {}, + -- ["@method"] = {}, -- TSMethod = {}, + -- ["@namespace"] = {}, -- TSNamespace = {}, + -- ["@none"] = {}, -- TSNone = {}, + -- ["@number"] = {}, -- TSNumber = {}, + ["@operator"] = { link = "ThemerOperator" }, TSOperator = { link = "ThemerOperator" }, + ["@parameter"] = { link = "ThemerParameter" }, TSParameter = { link = "ThemerParameter" }, + -- ["@parameter.reference"] = {}, -- TSParameterReference = {}, + ["@property"] = { link = "ThemerProperty" }, TSProperty = { link = "ThemerProperty" }, + ["@punctuation.bracket"] = { link = "ThemerPunctuation" }, TSPunctBracket = { link = "ThemerPunctuation" }, + ["@punctuation.delimiter"] = { link = "ThemerPunctuation" }, TSPunctDelimiter = { link = "ThemerPunctuation" }, + ["@punctuation.special"] = { link = "ThemerPunctuation" }, TSPunctSpecial = { link = "ThemerPunctuation" }, + -- ["@repeat"] = {}, -- TSRepeat = {}, + -- ["@text.strike"] = {}, -- TSStrike = {}, + ["@string"] = { link = "ThemerString" }, TSString = { link = "ThemerString" }, + -- ["@string.escape"] = { fg = cp.blue }, -- TSStringEscape = { fg = cp.blue }, + -- ["@string.regex"] = {}, -- TSStringRegex = {}, + -- ["@symbol"] = {}, -- TSSymbol = {}, + ["@tag"] = { fg = cp.syntax.tag or cp.statement }, TSTag = { fg = cp.syntax.tag or cp.statement }, + ["@tag.delimiter"] = { link = "ThemerSubtle" }, TSTagDelimiter = { link = "ThemerSubtle" }, + ["@text"] = { link = "ThemerText" }, TSText = { link = "ThemerText" }, + ["@text.title"] = { link = "ThemerHeadingH1" }, TSTitle = { link = "ThemerHeadingH1" }, + ["@type"] = { link = "ThemerType" }, TSType = { link = "ThemerType" }, + ["@type.builtin"] = { link = "ThemerTypeBuiltIn" }, TSTypeBuiltin = { link = "ThemerTypeBuiltIn" }, + ["@text.uri"] = { link = "ThemerURI" }, TSURI = { link = "ThemerURI" }, + -- ["@text.underline"] = {}, -- TSUnderline = {}, + ["@variable"] = { link = "ThemerVariable" }, TSVariable = { link = "ThemerVariable" }, + ["@variable.builtin"] = { link = "ThemerVariableBuiltIn" }, TSVariableBuiltin = { link = "ThemerVariableBuiltIn" }, commentTSDanger = { link = "DiagnosticError" }, commentTSNote = { link = "ThemerTodo" }, diff --git a/lua/themer/modules/core/utils.lua b/lua/themer/modules/core/utils.lua index 7c90e73..6e61178 100644 --- a/lua/themer/modules/core/utils.lua +++ b/lua/themer/modules/core/utils.lua @@ -8,6 +8,10 @@ local exec = vim.api.nvim_command --- @param group string --- @param color table utils.highlight_legacy = function(group, color) + if vim.fn.has("nvim-0.8") == 0 and group:find("@", 1, true) == 1 then + return + end + local parts = { group } parts[#parts + 1] = color.fg and "guifg=" .. color.fg or nil parts[#parts + 1] = color.bg and "guibg=" .. color.bg or nil diff --git a/lua/themer/modules/export/nvim.lua b/lua/themer/modules/export/nvim.lua index 90778a5..756294f 100644 --- a/lua/themer/modules/export/nvim.lua +++ b/lua/themer/modules/export/nvim.lua @@ -7,6 +7,10 @@ local nv = {} --- @param group string --- @param color table local function highlight(group, color) + if vim.fn.has("nvim-0.8") == 0 and group:find("@", 1, true) == 1 then + return + end + local parts = { group } parts[#parts + 1] = color.fg and "guifg=" .. color.fg or nil parts[#parts + 1] = color.bg and "guibg=" .. color.bg or nil diff --git a/lua/themer/modules/themes/papa_dark.lua b/lua/themer/modules/themes/papa_dark.lua index af30aea..2eb3b5d 100644 --- a/lua/themer/modules/themes/papa_dark.lua +++ b/lua/themer/modules/themes/papa_dark.lua @@ -141,30 +141,55 @@ color_palette.remaps = { }, plugins = { treesitter = { + ["@boolean"] = { link = "Boolean" }, TSBoolean = { link = "Boolean" }, + ["@character"] = { link = "Character" }, TSCharacter = { link = "Character" }, + ["@constant"] = { link = "Constant" }, TSConstant = { link = "Constant" }, + ["@error"] = { link = "Error" }, TSError = { link = "Error" }, + ["@field"] = { fg = colors.light_blue }, TSField = { fg = colors.light_blue }, + ["@function"] = { link = "Function" }, TSFunction = { link = "Function" }, + ["@function.builtin"] = { link = "Function" }, TSFuncBuiltin = { link = "Function" }, + ["@function.macro"] = { link = "Function" }, TSFuncMacro = { link = "Function" }, + ["@namespace"] = { fg = colors.cyan }, TSNamespace = { fg = colors.cyan }, + ["@type"] = { fg = colors.cyan }, TSType = { fg = colors.cyan }, + ["@type.builtin"] = { fg = colors.blue }, TSTypeBuiltin = { fg = colors.blue }, + ["@variable"] = { link = "TSField" }, TSVariable = { link = "TSField" }, + ["@property"] = { link = "TSField" }, TSProperty = { link = "TSField" }, + ["@keyword"] = { fg = colors.blue }, TSKeyword = { fg = colors.blue }, + ["@punctuation.bracket"] = { fg = colors.blue }, TSPunctBracket = { fg = colors.blue }, + ["@constructor"] = { fg = colors.blue }, TSConstructor = { fg = colors.blue }, + ["@method"] = { link = "Function" }, TSMethod = { link = "Function" }, + ["@keyword.function"] = { link = "Keyword" }, TSKeywordFunction = { link = "Keyword" }, + ["@conditional"] = { link = "Keyword" }, TSConditional = { link = "Keyword" }, + ["@constant.builtin"] = { link = "Keyword" }, TSConstBuiltin = { link = "Keyword" }, + ["@include"] = { link = "Keyword" }, TSInclude = { link = "Keyword" }, + ["@variable.builtin"] = { link = "Keyword" }, TSVariableBuiltin = { link = "Keyword" }, + ["@tag"] = { link = "Keyword" }, TSTag = { link = "Keyword" }, + ["@text.title"] = { link = "String" }, TSTitle = { link = "String" }, + ["@label"] = { link = "String" }, TSLabel = { link = "String" }, },