From 9941af1d6f0911e57e10588ef1c3e02154181c29 Mon Sep 17 00:00:00 2001 From: nullchilly Date: Wed, 13 Jul 2022 14:03:28 +0700 Subject: [PATCH 1/2] refactor(highlight): Deprecating style = string. Use style = table --- README.md | 40 +++++------ lua/catppuccin/config.lua | 40 +++++------ lua/catppuccin/core/integrations/cmp.lua | 6 +- .../core/integrations/dashboard.lua | 2 +- lua/catppuccin/core/integrations/feline.lua | 2 +- lua/catppuccin/core/integrations/hop.lua | 2 +- lua/catppuccin/core/integrations/leap.lua | 2 +- .../core/integrations/lightspeed.lua | 16 ++--- lua/catppuccin/core/integrations/markdown.lua | 4 +- lua/catppuccin/core/integrations/mini.lua | 28 ++++---- lua/catppuccin/core/integrations/neotree.lua | 2 +- lua/catppuccin/core/integrations/notify.lua | 10 +-- lua/catppuccin/core/integrations/nvimtree.lua | 2 +- .../core/integrations/telescope.lua | 2 +- .../core/integrations/treesitter.lua | 66 +++++++++---------- lua/catppuccin/core/mapper.lua | 42 ++++++------ lua/catppuccin/utils/util.lua | 17 ++--- 17 files changed, 138 insertions(+), 145 deletions(-) diff --git a/README.md b/README.md index 026913d..4ac9355 100644 --- a/README.md +++ b/README.md @@ -87,34 +87,34 @@ dim_inactive = false, transparent_background = false, term_colors = false, styles = { - comments = "italic", - conditionals = "italic", - loops = "NONE", - functions = "NONE", - keywords = "NONE", - strings = "NONE", - variables = "NONE", - numbers = "NONE", - booleans = "NONE", - properties = "NONE", - types = "NONE", - operators = "NONE", + comments = { "italic" }, + conditionals = { "italic" }, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + operators = {}, }, integrations = { treesitter = true, native_lsp = { enabled = true, virtual_text = { - errors = "italic", - hints = "italic", - warnings = "italic", - information = "italic", + errors = { "italic" }, + hints = { "italic" }, + warnings = { "italic" }, + information = { "italic" }, }, underlines = { - errors = "underline", - hints = "underline", - warnings = "underline", - information = "underline", + errors = { "underline" }, + hints = { "underline" }, + warnings = { "underline" }, + information = { "underline" }, }, }, coc_nvim = false, diff --git a/lua/catppuccin/config.lua b/lua/catppuccin/config.lua index b29ae42..ae9dcb8 100644 --- a/lua/catppuccin/config.lua +++ b/lua/catppuccin/config.lua @@ -10,34 +10,34 @@ config.options = { percentage = 0.15 }, styles = { - comments = "italic", - conditionals = "italic", - loops = "NONE", - functions = "NONE", - keywords = "NONE", - strings = "NONE", - variables = "NONE", - numbers = "NONE", - booleans = "NONE", - properties = "NONE", - types = "NONE", - operators = "NONE", + comments = { "italic" }, + conditionals = { "italic" }, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + operators = {}, }, integrations = { treesitter = true, native_lsp = { enabled = true, virtual_text = { - errors = "italic", - hints = "italic", - warnings = "italic", - information = "italic", + errors = { "italic" }, + hints = { "italic" }, + warnings = { "italic" }, + information = { "italic" }, }, underlines = { - errors = "underline", - hints = "underline", - warnings = "underline", - information = "underline", + errors = { "underline" }, + hints = { "underline" }, + warnings = { "underline" }, + information = { "underline" }, }, }, coc_nvim = false, diff --git a/lua/catppuccin/core/integrations/cmp.lua b/lua/catppuccin/core/integrations/cmp.lua index 57b0afb..513aeb9 100644 --- a/lua/catppuccin/core/integrations/cmp.lua +++ b/lua/catppuccin/core/integrations/cmp.lua @@ -3,11 +3,11 @@ local M = {} function M.get(cp) return { CmpItemAbbr = { fg = cp.overlay2 }, - CmpItemAbbrDeprecated = { fg = cp.overlay0, style = "strikethrough" }, + CmpItemAbbrDeprecated = { fg = cp.overlay0, style = { "strikethrough" } }, CmpItemKind = { fg = cp.blue }, CmpItemMenu = { fg = cp.text }, - CmpItemAbbrMatch = { fg = cp.text, style = "bold" }, - CmpItemAbbrMatchFuzzy = { fg = cp.text, style = "bold" }, + CmpItemAbbrMatch = { fg = cp.text, style = { "bold" } }, + CmpItemAbbrMatchFuzzy = { fg = cp.text, style = { "bold" } }, -- kind support CmpItemKindSnippet = { fg = cp.mauve }, diff --git a/lua/catppuccin/core/integrations/dashboard.lua b/lua/catppuccin/core/integrations/dashboard.lua index 4620800..b5d2c08 100644 --- a/lua/catppuccin/core/integrations/dashboard.lua +++ b/lua/catppuccin/core/integrations/dashboard.lua @@ -5,7 +5,7 @@ function M.get(cp) DashboardShortCut = { fg = cp.pink }, DashboardHeader = { fg = cp.blue }, DashboardCenter = { fg = cp.green }, - DashboardFooter = { fg = cp.yellow, style = "italic" }, + DashboardFooter = { fg = cp.yellow, style = { "italic" } }, } end diff --git a/lua/catppuccin/core/integrations/feline.lua b/lua/catppuccin/core/integrations/feline.lua index b2a347c..aff1094 100644 --- a/lua/catppuccin/core/integrations/feline.lua +++ b/lua/catppuccin/core/integrations/feline.lua @@ -114,7 +114,7 @@ local vi_mode_hl = function() return { fg = sett.bkg, bg = mode_colors[vim.fn.mode()][2], - style = "bold", + style = { "bold" }, } end diff --git a/lua/catppuccin/core/integrations/hop.lua b/lua/catppuccin/core/integrations/hop.lua index f4ed799..192a78b 100644 --- a/lua/catppuccin/core/integrations/hop.lua +++ b/lua/catppuccin/core/integrations/hop.lua @@ -3,7 +3,7 @@ local M = {} function M.get(cp) return { HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, + HopNextKey1 = { bg = cp.base, fg = cp.blue, style = { "bold" } }, HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, } diff --git a/lua/catppuccin/core/integrations/leap.lua b/lua/catppuccin/core/integrations/leap.lua index ae84e99..9846568 100644 --- a/lua/catppuccin/core/integrations/leap.lua +++ b/lua/catppuccin/core/integrations/leap.lua @@ -31,7 +31,7 @@ function M.get(cp) LeapLabelPrimary = {bg = cp.surface1, fg = cp.text}, LeapLabelSecondary = {bg = cp.surface1, fg = cp.text}, LeapBackdrop = {bg = cp.base, fg = cp.overlay0}, - LeapMatch = {bg = cp.base, fg = cp.red, style = "underline"}, + LeapMatch = {bg = cp.base, fg = cp.red, style = { "underline" }}, } end diff --git a/lua/catppuccin/core/integrations/lightspeed.lua b/lua/catppuccin/core/integrations/lightspeed.lua index 4b90a9e..e8ccf02 100644 --- a/lua/catppuccin/core/integrations/lightspeed.lua +++ b/lua/catppuccin/core/integrations/lightspeed.lua @@ -28,15 +28,15 @@ function M.get(cp) LightspeedOverlapped = {bg = cp.surface1, fg = cp.text}, LightspeedLabelDistant = {bg = cp.mauve, fg = cp.text}, LightspeedLabelDistantOverlapped = {bg = cp.mauve, fg = cp.text}, - LightspeedShortcut = {bg = cp.base, fg = cp.peach, style = "italic"}, - LightspeedShortcutOverlapped = {bg = cp.base, fg = cp.peach, style = "bold"}, - LightspeedMaskedChar = {bg = cp.base, fg = cp.red, style = "undercurl"}, + LightspeedShortcut = {bg = cp.base, fg = cp.peach, style = { "italic" }}, + LightspeedShortcutOverlapped = {bg = cp.base, fg = cp.peach, style = { "bold" }}, + LightspeedMaskedChar = {bg = cp.base, fg = cp.red, style = { "undercurl" }}, LightspeedGreyWash = {bg = cp.base, fg = cp.overlay0}, - LightspeedUnlabeledMatch = {bg = cp.base, fg = cp.red, style = "underline"}, - LightspeedOneCharMatch = {bg = cp.base, fg = cp.red, style = "underline"}, - LightspeedUniqueChar = {bg = cp.base, fg = cp.green, style = "strikethrough"}, - LightspeedPendingOpArea = {bg = cp.base, fg = cp.green, style = "strikethrough"}, - LightspeedPendingChangeOpArea = {bg = cp.base, fg = cp.green, style = "strikethrough"}, + LightspeedUnlabeledMatch = {bg = cp.base, fg = cp.red, style = { "underline" }}, + LightspeedOneCharMatch = {bg = cp.base, fg = cp.red, style = { "underline" }}, + LightspeedUniqueChar = {bg = cp.base, fg = cp.green, style = { "strikethrough" }}, + LightspeedPendingOpArea = {bg = cp.base, fg = cp.green, style = { "strikethrough" }}, + LightspeedPendingChangeOpArea = {bg = cp.base, fg = cp.green, style = { "strikethrough" }}, LightspeedCursor = {fg = cp.base, bg = cp.text}, } end diff --git a/lua/catppuccin/core/integrations/markdown.lua b/lua/catppuccin/core/integrations/markdown.lua index bdd68d2..cb80ff4 100644 --- a/lua/catppuccin/core/integrations/markdown.lua +++ b/lua/catppuccin/core/integrations/markdown.lua @@ -2,10 +2,10 @@ local M = {} function M.get(cp) return { - markdownHeadingDelimiter = { fg = cp.peach, style = "bold" }, + markdownHeadingDelimiter = { fg = cp.peach, style = { "bold" } }, markdownCode = { fg = cp.flamingo }, markdownCodeBlock = { fg = cp.flamingo }, - markdownLinkText = { fg = cp.blue, style = "underline" }, + markdownLinkText = { fg = cp.blue, style = { "underline" } }, markdownH1 = { fg = cp.lavender }, markdownH2 = { fg = cp.mauve }, markdownH3 = { fg = cp.green }, diff --git a/lua/catppuccin/core/integrations/mini.lua b/lua/catppuccin/core/integrations/mini.lua index 4280394..0bc9507 100644 --- a/lua/catppuccin/core/integrations/mini.lua +++ b/lua/catppuccin/core/integrations/mini.lua @@ -7,20 +7,20 @@ function M.get(cp) local inactive_bg = transparent_background and "NONE" or cp.mantle return { - MiniCompletionActiveParameter = { style = "underline" }, + MiniCompletionActiveParameter = { style = { "underline" } }, - MiniCursorword = { style = "underline" }, - MiniCursorwordCurrent = { style = "underline" }, + MiniCursorword = { style = { "underline" } }, + MiniCursorwordCurrent = { style = { "underline" } }, MiniIndentscopeSymbol = { fg = cp.text }, - MiniIndentscopePrefix = { style = "nocombine" }, -- Make it invisible + MiniIndentscopePrefix = { style = { "nocombine" } }, -- Make it invisible MiniJump = { fg = cp.overlay2, bg = cp.pink }, MiniJump2dSpot = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, MiniStarterCurrent = {}, - MiniStarterFooter = { fg = cp.yellow, style = "italic" }, + MiniStarterFooter = { fg = cp.yellow, style = { "italic" } }, MiniStarterHeader = { fg = cp.blue }, MiniStarterInactive = { fg = cp.surface2, style = cnf.styles.comments }, MiniStarterItem = { fg = cp.text }, @@ -33,12 +33,12 @@ function M.get(cp) MiniStatuslineFileinfo = { fg = cp.subtext1, bg = cp.surface1 }, MiniStatuslineFilename = { fg = cp.text, bg = cp.mantle }, MiniStatuslineInactive = { fg = cp.blue, bg = cp.mantle }, - MiniStatuslineModeCommand = { fg = cp.base, bg = cp.peach, style = "bold" }, - MiniStatuslineModeInsert = { fg = cp.base, bg = cp.green, style = "bold" }, - MiniStatuslineModeNormal = { fg = cp.mantle, bg = cp.blue, style = "bold" }, - MiniStatuslineModeOther = { fg = cp.base, bg = cp.teal, style = "bold" }, - MiniStatuslineModeReplace = { fg = cp.base, bg = cp.red, style = "bold" }, - MiniStatuslineModeVisual = { fg = cp.base, bg = cp.mauve, style = "bold" }, + MiniStatuslineModeCommand = { fg = cp.base, bg = cp.peach, style = { "bold" } }, + MiniStatuslineModeInsert = { fg = cp.base, bg = cp.green, style = { "bold" } }, + MiniStatuslineModeNormal = { fg = cp.mantle, bg = cp.blue, style = { "bold" } }, + MiniStatuslineModeOther = { fg = cp.base, bg = cp.teal, style = { "bold" } }, + MiniStatuslineModeReplace = { fg = cp.base, bg = cp.red, style = { "bold" } }, + MiniStatuslineModeVisual = { fg = cp.base, bg = cp.mauve, style = { "bold" } }, MiniSurround = { bg = cp.pink, fg = cp.surface1 }, @@ -51,9 +51,9 @@ function M.get(cp) MiniTablineTabpagesection = { fg = cp.surface1, bg = cp.base }, MiniTablineVisible = { fg = cp.subtext1, bg = cp.surface1 }, - MiniTestEmphasis = { style = "bold" }, - MiniTestFail = { fg = cp.red, style = "bold" }, - MiniTestPass = { fg = cp.green, style = "bold" }, + MiniTestEmphasis = { style = { "bold" } }, + MiniTestFail = { fg = cp.red, style = { "bold" } }, + MiniTestPass = { fg = cp.green, style = { "bold" } }, MiniTrailspace = { bg = cp.red }, } diff --git a/lua/catppuccin/core/integrations/neotree.lua b/lua/catppuccin/core/integrations/neotree.lua index 2bc12a6..6befc5f 100644 --- a/lua/catppuccin/core/integrations/neotree.lua +++ b/lua/catppuccin/core/integrations/neotree.lua @@ -15,7 +15,7 @@ function M.get(cp) NeoTreeDirectoryIcon = { fg = cp.blue }, NeoTreeNormal = { fg = cp.text, bg = neotree.transparent_panel and "NONE" or cp.mantle }, NeoTreeIndentMarker = { fg = cp.overlay0 }, - NeoTreeRootName = { fg = root_dir_color, style = "bold" }, + NeoTreeRootName = { fg = root_dir_color, style = { "bold" } }, NeoTreeSymbolicLinkTarget = { fg = cp.pink }, NeoTreeGitModified = { fg = cp.yellow }, NeoTreeUntracked = { fg = cp.blue }, diff --git a/lua/catppuccin/core/integrations/notify.lua b/lua/catppuccin/core/integrations/notify.lua index 4088ee8..24748b3 100644 --- a/lua/catppuccin/core/integrations/notify.lua +++ b/lua/catppuccin/core/integrations/notify.lua @@ -4,19 +4,19 @@ function M.get(cp) return { NotifyERRORBorder = { fg = cp.red }, NotifyERRORIcon = { fg = cp.red }, - NotifyERRORTitle = { fg = cp.red, style = "italic" }, + NotifyERRORTitle = { fg = cp.red, style = { "italic" } }, NotifyWARNBorder = { fg = cp.yellow }, NotifyWARNIcon = { fg = cp.yellow }, - NotifyWARNTitle = { fg = cp.yellow, style = "italic" }, + NotifyWARNTitle = { fg = cp.yellow, style = { "italic" } }, NotifyINFOBorder = { fg = cp.blue }, NotifyINFOIcon = { fg = cp.blue }, - NotifyINFOTitle = { fg = cp.blue, style = "italic" }, + NotifyINFOTitle = { fg = cp.blue, style = { "italic" } }, NotifyDEBUGBorder = { fg = cp.peach }, NotifyDEBUGIcon = { fg = cp.peach }, - NotifyDEBUGTitle = { fg = cp.peach, style = "italic" }, + NotifyDEBUGTitle = { fg = cp.peach, style = { "italic" } }, NotifyTRACEBorder = { fg = cp.rosewater }, NotifyTRACEIcon = { fg = cp.rosewater }, - NotifyTRACETitle = { fg = cp.rosewater, style = "italic" }, + NotifyTRACETitle = { fg = cp.rosewater, style = { "italic" } }, } end diff --git a/lua/catppuccin/core/integrations/nvimtree.lua b/lua/catppuccin/core/integrations/nvimtree.lua index 3e83973..7be4a5b 100644 --- a/lua/catppuccin/core/integrations/nvimtree.lua +++ b/lua/catppuccin/core/integrations/nvimtree.lua @@ -18,7 +18,7 @@ function M.get(cp) NvimTreeEmptyFolderName = { fg = cp.blue }, NvimTreeIndentMarker = { fg = cp.overlay0 }, NvimTreeVertSplit = { fg = cp.base, bg = cp.base }, - NvimTreeRootFolder = { fg = root_dir_color, style = "bold" }, + NvimTreeRootFolder = { fg = root_dir_color, style = { "bold" } }, NvimTreeSymlink = { fg = cp.pink }, NvimTreeStatuslineNc = { fg = cp.mantle, bg = cp.mantle }, NvimTreeGitDirty = { fg = cp.yellow }, diff --git a/lua/catppuccin/core/integrations/telescope.lua b/lua/catppuccin/core/integrations/telescope.lua index 4321323..de1db92 100644 --- a/lua/catppuccin/core/integrations/telescope.lua +++ b/lua/catppuccin/core/integrations/telescope.lua @@ -4,7 +4,7 @@ function M.get(cp) return { TelescopeBorder = { fg = cp.blue }, TelescopeSelectionCaret = { fg = cp.flamingo }, - TelescopeSelection = { fg = cp.text, bg = cp.surface0, style = "bold" }, + TelescopeSelection = { fg = cp.text, bg = cp.surface0, style = { "bold" } }, TelescopeMatching = { fg = cp.blue }, TelescopePromptPrefix = { bg = cp.crust }, TelescopePromptNormal = { bg = cp.crust}, diff --git a/lua/catppuccin/core/integrations/treesitter.lua b/lua/catppuccin/core/integrations/treesitter.lua index 3340774..7729bed 100644 --- a/lua/catppuccin/core/integrations/treesitter.lua +++ b/lua/catppuccin/core/integrations/treesitter.lua @@ -14,38 +14,38 @@ function M.get(cp) -- TSError -> Error for example, so you do not have to define these unless -- you explicitly want to support Treesitter's improved syntax awareness. TSField = { fg = cp.teal }, -- For fields. - TSProperty = { fg = cp.teal, style = cnf.styles.properties or "NONE" }, -- Same as TSField. + TSProperty = { fg = cp.teal, style = cnf.styles.properties or {} }, -- Same as TSField. - TSInclude = { fg = cp.mauve, style = cnf.styles.keywords or "NONE" }, -- For includes: #include in C, use or extern crate in Rust, or require in Lua. - TSOperator = { fg = operators, style = cnf.styles.operators or "NONE" }, -- For any operator: +, but also -> and * in cp. - TSKeywordOperator = { fg = cp.mauve, style = cnf.styles.operators or "NONE" }, -- For new keyword operator - TSPunctSpecial = { fg = cp.sky, style = cnf.styles.operators or "NONE" }, -- For special punctutation that does not fall in the catagories before. + TSInclude = { fg = cp.mauve, style = cnf.styles.keywords or {} }, -- For includes: #include in C, use or extern crate in Rust, or require in Lua. + TSOperator = { fg = operators, style = cnf.styles.operators or {} }, -- For any operator: +, but also -> and * in cp. + TSKeywordOperator = { fg = cp.mauve, style = cnf.styles.operators or {} }, -- For new keyword operator + TSPunctSpecial = { fg = cp.sky, style = cnf.styles.operators or {} }, -- For special punctutation that does not fall in the catagories before. - TSFloat = { fg = math_logic, style = cnf.styles.numbers or "NONE" }, -- For floats. - TSNumber = { fg = math_logic, style = cnf.styles.numbers or "NONE" }, -- For all numbers - TSBoolean = { fg = math_logic, style = cnf.styles.booleans or "NONE" }, -- For booleans. + TSFloat = { fg = math_logic, style = cnf.styles.numbers or {} }, -- For floats. + TSNumber = { fg = math_logic, style = cnf.styles.numbers or {} }, -- For all numbers + TSBoolean = { fg = math_logic, style = cnf.styles.booleans or {} }, -- For booleans. TSConstructor = { fg = cp.sapphire }, -- For constructor calls and definitions: = { } in Lua, and Java constructors. TSConstant = { fg = cp.peach }, -- For constants - TSConditional = { fg = cl, style = cnf.styles.conditionals or "NONE" }, -- For keywords related to conditionnals. - TSRepeat = { fg = cl, style = cnf.styles.loops or "NONE" }, -- For keywords related to loops. - TSException = { fg = cp.mauve, style = cnf.styles.keywords or "NONE" }, -- For exception related keywords. + TSConditional = { fg = cl, style = cnf.styles.conditionals or {} }, -- For keywords related to conditionnals. + TSRepeat = { fg = cl, style = cnf.styles.loops or {} }, -- For keywords related to loops. + TSException = { fg = cp.mauve, style = cnf.styles.keywords or {} }, -- For exception related keywords. -- builtin - TSConstBuiltin = { fg = cp.peach, style = cnf.styles.keywords or "NONE" }, -- For constant that are built in the language: nil in Lua. - TSFuncBuiltin = { fg = cp.peach, style = cnf.styles.functions or "NONE" }, -- For builtin functions: table.insert in Lua. + TSConstBuiltin = { fg = cp.peach, style = cnf.styles.keywords or {} }, -- For constant that are built in the language: nil in Lua. + TSFuncBuiltin = { fg = cp.peach, style = cnf.styles.functions or {} }, -- For builtin functions: table.insert in Lua. - TSNamespace = { fg = cp.blue, style = "italic" }, -- For identifiers referring to modules and namespaces. - TSType = { fg = cp.yellow, style = cnf.styles.types or "NONE" }, -- For types. + TSNamespace = { fg = cp.blue, style = { "italic" } }, -- For identifiers referring to modules and namespaces. + TSType = { fg = cp.yellow, style = cnf.styles.types or {} }, -- For types. TSTypeBuiltin = { fg = cp.yellow, style = cnf.styles.properties or "italic" }, -- For builtin types. TSVariableBuiltin = { fg = cp.red }, -- Variable names that are defined by the languages, like this or self. - TSFunction = { fg = cp.blue, style = cnf.styles.functions or "NONE" }, -- For function (calls and definitions). - TSFuncMacro = { fg = cp.teal, style = cnf.styles.functions or "NONE" }, -- For macro defined functions (calls and definitions): each macro_rules in Ruscp. - TSParameter = { fg = cp.maroon, style = "italic" }, -- For parameters of a function. - TSKeywordFunction = { fg = cp.mauve, style = cnf.styles.keywords or "NONE" }, -- For keywords used to define a fuction. - TSKeyword = { fg = keywords, style = cnf.styles.keywords or "NONE" }, -- For keywords that don't fall in previous categories. - TSKeywordReturn = { fg = cp.mauve, style = cnf.styles.keywords or "NONE" }, + TSFunction = { fg = cp.blue, style = cnf.styles.functions or {} }, -- For function (calls and definitions). + TSFuncMacro = { fg = cp.teal, style = cnf.styles.functions or {} }, -- For macro defined functions (calls and definitions): each macro_rules in Ruscp. + TSParameter = { fg = cp.maroon, style = { "italic" } }, -- For parameters of a function. + TSKeywordFunction = { fg = cp.mauve, style = cnf.styles.keywords or {} }, -- For keywords used to define a fuction. + TSKeyword = { fg = keywords, style = cnf.styles.keywords or {} }, -- For keywords that don't fall in previous categories. + TSKeywordReturn = { fg = cp.mauve, style = cnf.styles.keywords or {} }, -- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. -- TSAttribute = { }; -- (unstable) TODO: docs -- TSCharacter = { }; -- For characters. @@ -57,18 +57,18 @@ function M.get(cp) -- TSError = { fg = cp.red }, -- For syntax/parser errors. -- rustTSField = { fg = cp.surface1 }, -- For fields. TSLabel = { fg = cp.sapphire }, -- For labels: label: in C and :label: in Lua. - TSMethod = { fg = cp.blue, style = cnf.styles.functions or "NONE" }, -- For method calls and definitions. + TSMethod = { fg = cp.blue, style = cnf.styles.functions or {} }, -- For method calls and definitions. -- TSNone = { }; -- TODO: docs -- TSParameterReference= { }; -- For references to parameters of a function. tomlTSProperty = { fg = cp.blue }, -- Differentiates between string and properties TSPunctDelimiter = { fg = cp.overlay2 }, -- For delimiters ie: . -- TSPunctBracket = { fg = delimeters }, -- For brackets and parenthesis. TSPunctBracket = { fg = cp.overlay2 }, -- For brackets and parenthesis. - TSString = { fg = cp.green, style = cnf.styles.strings or "NONE" }, -- For strings. - TSStringRegex = { fg = cp.peach, style = cnf.styles.strings or "NONE" }, -- For regexes. + TSString = { fg = cp.green, style = cnf.styles.strings or {} }, -- For strings. + TSStringRegex = { fg = cp.peach, style = cnf.styles.strings or {} }, -- For regexes. -- TSSymbol = { }; -- For identifiers referring to symbols or atoms. - TSVariable = { fg = cp.text, style = cnf.styles.variables or "NONE" }, -- Any variable name that does not have another highlighcp. - TSTagAttribute = { fg = cp.teal, style = "italic" }, -- Tags like html tag names. + TSVariable = { fg = cp.text, style = cnf.styles.variables or {} }, -- Any variable name that does not have another highlighcp. + TSTagAttribute = { fg = cp.teal, style = { "italic" } }, -- Tags like html tag names. TSTag = { fg = cp.mauve }, -- Tags like html tag names. TSTagDelimiter = { fg = cp.sky }, -- Tag delimiter like < > / TSText = { fg = cp.text }, -- For strings considerated text in a markup language. @@ -81,16 +81,16 @@ function M.get(cp) -- -- Markdown tresitter parser support TSURI = { fg = cp.rosewater, style = { "italic", "underline" } }, -- urls, links and emails - TSLiteral = { fg = cp.teal, style = "italic" }, -- used for inline code in markdown and for doc in python (""") - TSTextReference = { fg = cp.lavender, style = "bold" }, -- references - TSTitle = { fg = cp.blue, style = "bold" }, -- titles like: # Example - TSEmphasis = { fg = cp.maroon, style = "italic" }, -- bold - TSStrong = { fg = cp.maroon, style = "bold" }, -- italic + TSLiteral = { fg = cp.teal, style = { "italic" } }, -- used for inline code in markdown and for doc in python (""") + TSTextReference = { fg = cp.lavender, style = { "bold" } }, -- references + TSTitle = { fg = cp.blue, style = { "bold" } }, -- titles like: # Example + TSEmphasis = { fg = cp.maroon, style = { "italic" } }, -- bold + TSStrong = { fg = cp.maroon, style = { "bold" } }, -- italic TSStringEscape = { fg = cp.pink, style = cnf.styles.strings }, -- For escape characters within a string. -- bash - -- bashTSFuncBuiltin = { fg = cp.red, style = "italic" }, - -- bashTSParameter = { fg = cp.yellow, style = "italic" }, + -- bashTSFuncBuiltin = { fg = cp.red, style = { "italic" } }, + -- bashTSParameter = { fg = cp.yellow, style = { "italic" } }, -- json jsonTSLabel = { fg = cp.blue }, -- For labels: label: in C and :label: in Lua. diff --git a/lua/catppuccin/core/mapper.lua b/lua/catppuccin/core/mapper.lua index 3359662..6cefeb8 100644 --- a/lua/catppuccin/core/mapper.lua +++ b/lua/catppuccin/core/mapper.lua @@ -43,8 +43,8 @@ local function get_base() Substitute = { bg = cp.surface1, fg = cp.pink }, -- |:substitute| replacement text highlighting LineNr = { fg = ucolors.vary_color({ latte = cp.base0 }, cp.surface1) }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is secp. CursorLineNr = { fg = cp.lavender }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. highlights the number in numberline. - MatchParen = { fg = cp.peach, style = "bold" }, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt| - ModeMsg = { fg = cp.text, style = "bold" }, -- 'showmode' message (e.g., "-- INSERT -- ") + MatchParen = { fg = cp.peach, style = { "bold" } }, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt| + ModeMsg = { fg = cp.text, style = { "bold" } }, -- 'showmode' message (e.g., "-- INSERT -- ") MsgArea = { fg = cp.text }, -- Area for messages and cmdline MsgSeparator = {}, -- Separator for scrolled messages, `msgsep` flag of 'display' MoreMsg = { fg = cp.blue }, -- |more-prompt| @@ -61,27 +61,27 @@ local function get_base() NormalFloat = { fg = cp.text, bg = cp.mantle }, -- Normal text in floating windows. FloatBorder = { fg = cp.blue }, Pmenu = { bg = cp.surface0, fg = cp.overlay2 }, -- Popup menu: normal item. - PmenuSel = { fg = cp.text, bg = cp.surface1, style = "bold" }, -- Popup menu: selected item. + PmenuSel = { fg = cp.text, bg = cp.surface1, style = { "bold" } }, -- Popup menu: selected item. PmenuSbar = { bg = cp.surface1 }, -- Popup menu: scrollbar. PmenuThumb = { bg = cp.overlay0 }, -- Popup menu: Thumb of the scrollbar. Question = { fg = cp.blue }, -- |hit-enter| prompt and yes/no questions - QuickFixLine = { bg = cp.surface1, style = "bold" }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there. + QuickFixLine = { bg = cp.surface1, style = { "bold" } }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there. Search = { bg = ucolors.darken(cp.sky, 0.30, cp.base), fg = cp.text }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand oucp. IncSearch = { bg = ucolors.darken(cp.sky, 0.90, cp.base), fg = cp.mantle }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c" CurSearch = { bg = cp.red, fg = cp.mantle }, -- 'cursearch' highlighting: highlights the current search you're on differently SpecialKey = { fg = cp.text }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' textspace. |hl-Whitespace| - SpellBad = { sp = cp.red, style = "undercurl" }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. - SpellCap = { sp = cp.yellow, style = "undercurl" }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise. - SpellLocal = { sp = cp.blue, style = "undercurl" }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise. - SpellRare = { sp = cp.green, style = "undercurl" }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. + SpellBad = { sp = cp.red, style = { "undercurl" } }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. + SpellCap = { sp = cp.yellow, style = { "undercurl" } }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise. + SpellLocal = { sp = cp.blue, style = { "undercurl" } }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise. + SpellRare = { sp = cp.green, style = { "undercurl" } }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. StatusLine = { fg = cp.text, bg = cp.mantle }, -- status line of current window StatusLineNC = { fg = cp.surface1, bg = cp.mantle }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. TabLine = { bg = cp.mantle, fg = cp.surface1 }, -- tab pages line, not active tab page label TabLineFill = { bg = cp.black }, -- tab pages line, where there are no labels TabLineSel = { fg = cp.green, bg = cp.surface1 }, -- tab pages line, active tab page label - Title = { fg = cp.blue, style = "bold" }, -- titles for output from ":set all", ":autocmd" etcp. - Visual = { bg = cp.surface1, style = "bold" }, -- Visual mode selection - VisualNOS = { bg = cp.surface1, style = "bold" }, -- Visual mode selection when vim is "Not Owning the Selection". + Title = { fg = cp.blue, style = { "bold" } }, -- titles for output from ":set all", ":autocmd" etcp. + Visual = { bg = cp.surface1, style = { "bold" } }, -- Visual mode selection + VisualNOS = { bg = cp.surface1, style = { "bold" } }, -- Visual mode selection when vim is "Not Owning the Selection". WarningMsg = { fg = cp.yellow }, -- warning messages Whitespace = { fg = cp.surface1 }, -- "nbsp", "space", "tab" and "trail" in 'listchars' WildMenu = { bg = cp.overlay0 }, -- current match in 'wildmenu' completion @@ -127,24 +127,24 @@ local function get_base() -- Specialoverlay0= { }, -- special things inside a overlay0 -- Debug = { }, -- debugging statements - Underlined = { style = "underline" }, -- (preferred) text that stands out, HTML links - Bold = { style = "bold" }, - Italic = { style = "italic" }, + Underlined = { style = { "underline" } }, -- (preferred) text that stands out, HTML links + Bold = { style = { "bold" } }, + Italic = { style = { "italic" } }, -- ("Ignore", below, may be invisible...) -- Ignore = { }, -- (preferred) left blank, hidden |hl-Ignore| Error = { fg = cp.red }, -- (preferred) any erroneous construct - Todo = { bg = cp.yellow, fg = cp.base, style = "bold" }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX + Todo = { bg = cp.yellow, fg = cp.base, style = { "bold" } }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX qfLineNr = { fg = cp.yellow }, qfFileName = { fg = cp.blue }, - htmlH1 = { fg = cp.pink, style = "bold" }, - htmlH2 = { fg = cp.blue, style = "bold" }, - -- mkdHeading = { fg = cp.peach, style = "bold" }, + htmlH1 = { fg = cp.pink, style = { "bold" } }, + htmlH2 = { fg = cp.blue, style = { "bold" } }, + -- mkdHeading = { fg = cp.peach, style = { "bold" } }, -- mkdCode = { bg = cp.terminal_black, fg = cp.text }, mkdCodeDelimiter = { bg = cp.base, fg = cp.text }, - mkdCodeStart = { fg = cp.flamingo, style = "bold" }, - mkdCodeEnd = { fg = cp.flamingo, style = "bold" }, - -- mkdLink = { fg = cp.blue, style = "underline" }, + mkdCodeStart = { fg = cp.flamingo, style = { "bold" } }, + mkdCodeEnd = { fg = cp.flamingo, style = { "bold" } }, + -- mkdLink = { fg = cp.blue, style = { "underline" } }, -- debugging debugPC = { bg = cp.crust }, -- used for highlighting the current line in terminal-debug diff --git a/lua/catppuccin/utils/util.lua b/lua/catppuccin/utils/util.lua index be3e05b..f9a2bf1 100644 --- a/lua/catppuccin/utils/util.lua +++ b/lua/catppuccin/utils/util.lua @@ -11,26 +11,19 @@ function util.highlight(group, color) }) else if color.style then - if color.style ~= "NONE" then - if type(color.style) == "table" then - for _, style in ipairs(color.style) do - color[style] = true - end - else - color[color.style] = true - end + for _, style in ipairs(color.style) do + color[style] = true end end color.style = nil vim.api.nvim_set_hl(0, group, color) end - else - -- Doc: :h highlight-gui - if color.style and type(color.style) == "table" then + else -- Doc: :h highlight-gui + if color.style then color.style = table.concat(color.style, ",") end - local style = color.style and "gui=" .. color.style or "gui=NONE" + local style = (color.style and color.style ~= "") and "gui=" .. color.style or "gui=NONE" local fg = color.fg and "guifg=" .. color.fg or "guifg=NONE" local bg = color.bg and "guibg=" .. color.bg or "guibg=NONE" local sp = color.sp and "guisp=" .. color.sp or "" From 96240e41fd86d3cf315c05e9d35d19399097d20c Mon Sep 17 00:00:00 2001 From: nullchilly Date: Wed, 13 Jul 2022 22:27:56 +0700 Subject: [PATCH 2/2] refactor(highlight): Resolve conflict --- lua/catppuccin/config.lua | 13 -- lua/catppuccin/config.lua.orig | 102 -------------- lua/catppuccin/core/integrations/hop.lua.orig | 16 --- .../core/integrations/hop_BACKUP_644994.lua | 16 --- .../core/integrations/hop_BACKUP_646467.lua | 16 --- .../core/integrations/hop_BASE_644994.lua | 12 -- .../core/integrations/hop_BASE_646467.lua | 12 -- .../core/integrations/hop_LOCAL_644994.lua | 12 -- .../core/integrations/hop_LOCAL_646467.lua | 12 -- .../core/integrations/hop_REMOTE_644994.lua | 12 -- .../core/integrations/hop_REMOTE_646467.lua | 12 -- .../core/integrations/treesitter.lua.orig | 124 ------------------ lua/catppuccin/utils/util.lua.orig | 115 ---------------- 13 files changed, 474 deletions(-) delete mode 100644 lua/catppuccin/config.lua.orig delete mode 100644 lua/catppuccin/core/integrations/hop.lua.orig delete mode 100644 lua/catppuccin/core/integrations/hop_BACKUP_644994.lua delete mode 100644 lua/catppuccin/core/integrations/hop_BACKUP_646467.lua delete mode 100644 lua/catppuccin/core/integrations/hop_BASE_644994.lua delete mode 100644 lua/catppuccin/core/integrations/hop_BASE_646467.lua delete mode 100644 lua/catppuccin/core/integrations/hop_LOCAL_644994.lua delete mode 100644 lua/catppuccin/core/integrations/hop_LOCAL_646467.lua delete mode 100644 lua/catppuccin/core/integrations/hop_REMOTE_644994.lua delete mode 100644 lua/catppuccin/core/integrations/hop_REMOTE_646467.lua delete mode 100644 lua/catppuccin/core/integrations/treesitter.lua.orig delete mode 100644 lua/catppuccin/utils/util.lua.orig diff --git a/lua/catppuccin/config.lua b/lua/catppuccin/config.lua index 2b8331a..a6bd278 100644 --- a/lua/catppuccin/config.lua +++ b/lua/catppuccin/config.lua @@ -17,7 +17,6 @@ config.options = { styles = { comments = { "italic" }, conditionals = { "italic" }, -<<<<<<< HEAD loops = {}, functions = {}, keywords = {}, @@ -28,18 +27,6 @@ config.options = { properties = {}, types = {}, operators = {}, -======= - loops = "NONE", - functions = "NONE", - keywords = "NONE", - strings = "NONE", - variables = "NONE", - numbers = "NONE", - booleans = "NONE", - properties = "NONE", - types = "NONE", - operators = "NONE", ->>>>>>> origin/dev }, integrations = { treesitter = true, diff --git a/lua/catppuccin/config.lua.orig b/lua/catppuccin/config.lua.orig deleted file mode 100644 index 5429b0d..0000000 --- a/lua/catppuccin/config.lua.orig +++ /dev/null @@ -1,102 +0,0 @@ ----@class Config -local config = {} - -config.options = { - transparent_background = false, - term_colors = false, - dim_inactive = { - enable = false, - shade = "dark", - percentage = 0.15, - }, - styles = { - comments = { "italic" }, - conditionals = { "italic" }, -<<<<<<< HEAD - loops = {}, - functions = {}, - keywords = {}, - strings = {}, - variables = {}, - numbers = {}, - booleans = {}, - properties = {}, - types = {}, - operators = {}, -======= - loops = "NONE", - functions = "NONE", - keywords = "NONE", - strings = "NONE", - variables = "NONE", - numbers = "NONE", - booleans = "NONE", - properties = "NONE", - types = "NONE", - operators = "NONE", ->>>>>>> origin/dev - }, - integrations = { - treesitter = true, - native_lsp = { - enabled = true, - virtual_text = { - errors = { "italic" }, - hints = { "italic" }, - warnings = { "italic" }, - information = { "italic" }, - }, - underlines = { - errors = { "underline" }, - hints = { "underline" }, - warnings = { "underline" }, - information = { "underline" }, - }, - }, - coc_nvim = false, - lsp_trouble = false, - cmp = true, - lsp_saga = false, - gitgutter = false, - gitsigns = true, - telescope = true, - nvimtree = { - enabled = true, - show_root = false, - transparent_panel = false, - }, - neotree = { - enabled = false, - show_root = false, - transparent_panel = false, - }, - which_key = false, - indent_blankline = { - enabled = true, - colored_indent_levels = false, - }, - dashboard = true, - neogit = false, - vim_sneak = false, - fern = false, - barbar = false, - bufferline = true, - markdown = true, - lightspeed = false, - leap = false, - ts_rainbow = false, - hop = false, - notify = true, - telekasten = true, - symbols_outline = true, - }, - color_overrides = {}, - custom_highlights = {}, -} - -function config.set_options(opts) - opts = opts or {} - config.options = vim.tbl_deep_extend("force", config.options, opts) -end - -return config diff --git a/lua/catppuccin/core/integrations/hop.lua.orig b/lua/catppuccin/core/integrations/hop.lua.orig deleted file mode 100644 index 863145c..0000000 --- a/lua/catppuccin/core/integrations/hop.lua.orig +++ /dev/null @@ -1,16 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, -<<<<<<< HEAD - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = { "bold" } }, -======= - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, ->>>>>>> origin/dev - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_BACKUP_644994.lua b/lua/catppuccin/core/integrations/hop_BACKUP_644994.lua deleted file mode 100644 index 863145c..0000000 --- a/lua/catppuccin/core/integrations/hop_BACKUP_644994.lua +++ /dev/null @@ -1,16 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, -<<<<<<< HEAD - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = { "bold" } }, -======= - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, ->>>>>>> origin/dev - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_BACKUP_646467.lua b/lua/catppuccin/core/integrations/hop_BACKUP_646467.lua deleted file mode 100644 index 863145c..0000000 --- a/lua/catppuccin/core/integrations/hop_BACKUP_646467.lua +++ /dev/null @@ -1,16 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, -<<<<<<< HEAD - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = { "bold" } }, -======= - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, ->>>>>>> origin/dev - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_BASE_644994.lua b/lua/catppuccin/core/integrations/hop_BASE_644994.lua deleted file mode 100644 index 72cd3cf..0000000 --- a/lua/catppuccin/core/integrations/hop_BASE_644994.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = "bold,underline" }, - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = "bold,italic" }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_BASE_646467.lua b/lua/catppuccin/core/integrations/hop_BASE_646467.lua deleted file mode 100644 index 72cd3cf..0000000 --- a/lua/catppuccin/core/integrations/hop_BASE_646467.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = "bold,underline" }, - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = "bold,italic" }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_LOCAL_644994.lua b/lua/catppuccin/core/integrations/hop_LOCAL_644994.lua deleted file mode 100644 index 192a78b..0000000 --- a/lua/catppuccin/core/integrations/hop_LOCAL_644994.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = { "bold" } }, - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_LOCAL_646467.lua b/lua/catppuccin/core/integrations/hop_LOCAL_646467.lua deleted file mode 100644 index 192a78b..0000000 --- a/lua/catppuccin/core/integrations/hop_LOCAL_646467.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = { "bold" } }, - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_REMOTE_644994.lua b/lua/catppuccin/core/integrations/hop_REMOTE_644994.lua deleted file mode 100644 index f4ed799..0000000 --- a/lua/catppuccin/core/integrations/hop_REMOTE_644994.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/hop_REMOTE_646467.lua b/lua/catppuccin/core/integrations/hop_REMOTE_646467.lua deleted file mode 100644 index f4ed799..0000000 --- a/lua/catppuccin/core/integrations/hop_REMOTE_646467.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - -function M.get(cp) - return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, - HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, - HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, - } -end - -return M diff --git a/lua/catppuccin/core/integrations/treesitter.lua.orig b/lua/catppuccin/core/integrations/treesitter.lua.orig deleted file mode 100644 index 94afeb5..0000000 --- a/lua/catppuccin/core/integrations/treesitter.lua.orig +++ /dev/null @@ -1,124 +0,0 @@ -local M = {} - -function M.get(cp) - -- local delimeters = cp.overlay2 - local operators = cp.sky - local cl = cp.mauve -- conditionals, loops - local keywords = cp.mauve - - local math_logic = cp.peach - return { - -- These groups are for the neovim tree-sitter highlights. - -- As of writing, tree-sitter support is a WIP, group names may change. - -- By default, most of these groups link to an appropriate Vim group, - -- TSError -> Error for example, so you do not have to define these unless - -- you explicitly want to support Treesitter's improved syntax awareness. - TSField = { fg = cp.teal }, -- For fields. - TSProperty = { fg = cp.teal, style = cnf.styles.properties or {} }, -- Same as TSField. - - TSInclude = { fg = cp.mauve, style = cnf.styles.keywords or {} }, -- For includes: #include in C, use or extern crate in Rust, or require in Lua. - TSOperator = { fg = operators, style = cnf.styles.operators or {} }, -- For any operator: +, but also -> and * in cp. - TSKeywordOperator = { fg = cp.mauve, style = cnf.styles.operators or {} }, -- For new keyword operator - TSPunctSpecial = { fg = cp.sky, style = cnf.styles.operators or {} }, -- For special punctutation that does not fall in the catagories before. - - TSFloat = { fg = math_logic, style = cnf.styles.numbers or {} }, -- For floats. - TSNumber = { fg = math_logic, style = cnf.styles.numbers or {} }, -- For all numbers - TSBoolean = { fg = math_logic, style = cnf.styles.booleans or {} }, -- For booleans. - - TSConstructor = { fg = cp.sapphire }, -- For constructor calls and definitions: = { } in Lua, and Java constructors. - TSConstant = { fg = cp.peach }, -- For constants - TSConditional = { fg = cl, style = cnf.styles.conditionals or {} }, -- For keywords related to conditionnals. - TSRepeat = { fg = cl, style = cnf.styles.loops or {} }, -- For keywords related to loops. - TSException = { fg = cp.mauve, style = cnf.styles.keywords or {} }, -- For exception related keywords. - - -- builtin - TSConstBuiltin = { fg = cp.peach, style = cnf.styles.keywords or {} }, -- For constant that are built in the language: nil in Lua. - TSFuncBuiltin = { fg = cp.peach, style = cnf.styles.functions or {} }, -- For builtin functions: table.insert in Lua. - - TSNamespace = { fg = cp.blue, style = { "italic" } }, -- For identifiers referring to modules and namespaces. - TSType = { fg = cp.yellow, style = cnf.styles.types or {} }, -- For types. - TSTypeBuiltin = { fg = cp.yellow, style = cnf.styles.properties or "italic" }, -- For builtin types. - TSVariableBuiltin = { fg = cp.red }, -- Variable names that are defined by the languages, like this or self. - - TSFunction = { fg = cp.blue, style = cnf.styles.functions or {} }, -- For function (calls and definitions). - TSFuncMacro = { fg = cp.teal, style = cnf.styles.functions or {} }, -- For macro defined functions (calls and definitions): each macro_rules in Ruscp. - TSParameter = { fg = cp.maroon, style = { "italic" } }, -- For parameters of a function. - TSKeywordFunction = { fg = cp.mauve, style = cnf.styles.keywords or {} }, -- For keywords used to define a fuction. - TSKeyword = { fg = keywords, style = cnf.styles.keywords or {} }, -- For keywords that don't fall in previous categories. - TSKeywordReturn = { fg = cp.mauve, style = cnf.styles.keywords or {} }, - -- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. - -- TSAttribute = { }; -- (unstable) TODO: docs - -- TSCharacter = { }; -- For characters. - -- TSoverlay0 = { }; -- For overlay0 blocks. - TSNote = { fg = cp.base, bg = cp.blue }, - TSWarning = { fg = cp.base, bg = cp.yellow }, - TSDanger = { fg = cp.base, bg = cp.red }, - TSConstMacro = { fg = cp.mauve }; -- For constants that are defined by macros: NULL in cp. - -- TSError = { fg = cp.red }, -- For syntax/parser errors. - -- rustTSField = { fg = cp.surface1 }, -- For fields. - TSLabel = { fg = cp.sapphire }, -- For labels: label: in C and :label: in Lua. - TSMethod = { fg = cp.blue, style = cnf.styles.functions or {} }, -- For method calls and definitions. - -- TSNone = { }; -- TODO: docs - -- TSParameterReference= { }; -- For references to parameters of a function. - tomlTSProperty = { fg = cp.blue }, -- Differentiates between string and properties - TSPunctDelimiter = { fg = cp.overlay2 }, -- For delimiters ie: . - -- TSPunctBracket = { fg = delimeters }, -- For brackets and parenthesis. - TSPunctBracket = { fg = cp.overlay2 }, -- For brackets and parenthesis. - TSString = { fg = cp.green, style = cnf.styles.strings or {} }, -- For strings. - TSStringRegex = { fg = cp.peach, style = cnf.styles.strings or {} }, -- For regexes. - -- TSSymbol = { }; -- For identifiers referring to symbols or atoms. - TSVariable = { fg = cp.text, style = cnf.styles.variables or {} }, -- Any variable name that does not have another highlighcp. - TSTagAttribute = { fg = cp.teal, style = { "italic" } }, -- Tags like html tag names. - TSTag = { fg = cp.mauve }, -- Tags like html tag names. - TSTagDelimiter = { fg = cp.sky }, -- Tag delimiter like < > / - TSText = { fg = cp.text }, -- For strings considerated text in a markup language. - -- TSEmphasis = { }; -- For text to be represented with emphasis. - -- TSUnderline = { }; -- For text to be represented with an underline. - -- TSStrike = { }; -- For strikethrough texcp. - -- TSTitle = { }; -- Text that is part of a title. - -- TSLiteral = { }; -- Literal texcp. - -- TSURI = { }; -- Any URI like a link or email. - -- - -- Markdown tresitter parser support - TSURI = { fg = cp.rosewater, style = { "italic", "underline" } }, -- urls, links and emails -<<<<<<< HEAD - TSLiteral = { fg = cp.teal, style = { "italic" } }, -- used for inline code in markdown and for doc in python (""") - TSTextReference = { fg = cp.lavender, style = { "bold" } }, -- references - TSTitle = { fg = cp.blue, style = { "bold" } }, -- titles like: # Example - TSEmphasis = { fg = cp.maroon, style = { "italic" } }, -- bold - TSStrong = { fg = cp.maroon, style = { "bold" } }, -- italic -======= - TSLiteral = { fg = cp.teal, style = "italic" }, -- used for inline code in markdown and for doc in python (""") - TSTextReference = { fg = cp.lavender, style = "bold" }, -- references - TSTitle = { fg = cp.blue, style = "bold" }, -- titles like: # Example - TSEmphasis = { fg = cp.maroon, style = "italic" }, -- bold - TSStrong = { fg = cp.maroon, style = "bold" }, -- italic ->>>>>>> origin/dev - TSStringEscape = { fg = cp.pink, style = cnf.styles.strings }, -- For escape characters within a string. - - -- bash - -- bashTSFuncBuiltin = { fg = cp.red, style = { "italic" } }, - -- bashTSParameter = { fg = cp.yellow, style = { "italic" } }, - - -- json - jsonTSLabel = { fg = cp.blue }, -- For labels: label: in C and :label: in Lua. - - -- lua - luaTSConstructor = { fg = cp.lavender }, -- For constructor calls and definitions: = { } in Lua, and Java constructors. - - -- typescript - typescriptTSConstructor = { fg = cp.lavender }, - - -- TSX (Typescript React) - tsxTSConstructor = { fg = cp.lavender }, - tsxTSTagAttribute = { fg = cp.mauve }, - - -- cpp - cppTSProperty = { fg = cp.rosewater }, - - -- yaml - yamlTSField = { fg = cp.blue }, -- For fields. - } -end - -return M diff --git a/lua/catppuccin/utils/util.lua.orig b/lua/catppuccin/utils/util.lua.orig deleted file mode 100644 index 74230ff..0000000 --- a/lua/catppuccin/utils/util.lua.orig +++ /dev/null @@ -1,115 +0,0 @@ -local g = vim.g -local util = {} - -local has_nvim07 = vim.fn.has("nvim-0.7") - -function util.highlight(group, color) - if has_nvim07 then - if color.link then - vim.api.nvim_set_hl(0, group, { - link = color.link, - }) - else - if color.style then -<<<<<<< HEAD - for _, style in ipairs(color.style) do - color[style] = true -======= - if color.style ~= "NONE" then - if type(color.style) == "table" then - for _, style in ipairs(color.style) do - color[style] = true - end - else - color[color.style] = true - end ->>>>>>> origin/dev - end - end - - color.style = nil - vim.api.nvim_set_hl(0, group, color) - end -<<<<<<< HEAD - else -- Doc: :h highlight-gui - if color.style then - color.style = table.concat(color.style, ",") - end - local style = (color.style and color.style ~= "") and "gui=" .. color.style or "gui=NONE" -======= - else - -- Doc: :h highlight-gui - if color.style and type(color.style) == "table" then - color.style = table.concat(color.style, ",") - end - local style = color.style and "gui=" .. color.style or "gui=NONE" ->>>>>>> origin/dev - local fg = color.fg and "guifg=" .. color.fg or "guifg=NONE" - local bg = color.bg and "guibg=" .. color.bg or "guibg=NONE" - local sp = color.sp and "guisp=" .. color.sp or "" - local blend = color.blend and "blend=" .. color.blend or "" - local hl = "highlight " .. group .. " " .. style .. " " .. fg .. " " .. bg .. " " .. sp .. " " .. blend - vim.cmd(hl) - if color.link then - vim.cmd("highlight! link " .. group .. " " .. color.link) - end - end -end - -function util.syntax(tbl) - for group, colors in pairs(tbl) do - util.highlight(group, colors) - end -end - -function util.properties(tbl) - for property, value in pairs(tbl) do - vim.o[property] = value - end -end - -function util.terminal(cp) - g.terminal_color_0 = cp.overlay0 - g.terminal_color_8 = cp.overlay1 - - g.terminal_color_1 = cp.red - g.terminal_color_9 = cp.red - - g.terminal_color_2 = cp.green - g.terminal_color_10 = cp.green - - g.terminal_color_3 = cp.yellow - g.terminal_color_11 = cp.yellow - - g.terminal_color_4 = cp.blue - g.terminal_color_12 = cp.blue - - g.terminal_color_5 = cp.pink - g.terminal_color_13 = cp.pink - - g.terminal_color_6 = cp.sky - g.terminal_color_14 = cp.sky - - g.terminal_color_7 = cp.text - g.terminal_color_15 = cp.text -end - -function util.load(theme) - vim.cmd("hi clear") - if vim.fn.exists("syntax_on") then - vim.cmd("syntax reset") - end - g.colors_name = "catppuccin" - local custom_highlights = require("catppuccin.config").options.custom_highlights - - util.properties(theme.properties) - util.syntax(theme.base) - util.syntax(theme.integrations) - util.syntax(custom_highlights) - - if require("catppuccin.config").options["term_colors"] then - util.terminal(theme.terminal) - end -end - -return util