Skip to content

Commit

Permalink
feat(treesitter): add styles.miscs to disable hardcoded italics (#659)
Browse files Browse the repository at this point in the history
* feat: add styles.miscs

---------

Co-authored-by: Laurens Rosinski <rosinski@duck.com>
Co-authored-by: Null Chilly <nullchilly@gmail.com>
  • Loading branch information
3 people authored Feb 24, 2024
1 parent 42b687c commit c0de3b4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ require("catppuccin").setup({
properties = {},
types = {},
operators = {},
-- miscs = {}, -- Uncomment to turn off hard-coded styles
},
color_overrides = {},
custom_highlights = {},
Expand Down
1 change: 1 addition & 0 deletions doc/catppuccin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ options and settings.
properties = {},
types = {},
operators = {},
-- miscs = {}, -- Uncomment to turn off hard-coded styles
},
color_overrides = {},
custom_highlights = {},
Expand Down
10 changes: 5 additions & 5 deletions lua/catppuccin/groups/integrations/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@constant.builtin"] = { fg = C.peach, style = O.styles.keywords or {} }, -- For constant that are built in the language: nil in Lua.
["@constant.macro"] = { link = "Macro" }, -- For constants that are defined by macros: NULL in C.

["@module"] = { fg = C.lavender, style = { "italic" } }, -- For identifiers referring to modules and namespaces.
["@module"] = { fg = C.lavender, style = O.styles.miscs or { "italic" } }, -- For identifiers referring to modules and namespaces.
["@label"] = { link = "Label" }, -- For labels: label: in C and :label: in Lua.

-- Literals
Expand Down Expand Up @@ -121,15 +121,15 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci

-- Tags
["@tag"] = { fg = C.mauve }, -- Tags like html tag names.
["@tag.attribute"] = { fg = C.teal, style = { "italic" } }, -- Tags like html tag names.
["@tag.attribute"] = { fg = C.teal, style = O.styles.miscs or { "italic" } }, -- Tags like html tag names.
["@tag.delimiter"] = { fg = C.sky }, -- Tag delimiter like < > /

-- Misc
["@error"] = { link = "Error" },

-- Language specific:
-- bash
["@function.builtin.bash"] = { fg = C.red, style = { "italic" } },
["@function.builtin.bash"] = { fg = C.red, style = O.styles.miscs or { "italic" } },

-- markdown
["@markup.heading.1.markdown"] = { link = "rainbow1" },
Expand Down Expand Up @@ -166,7 +166,7 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci

-- TSX (Typescript React)
["@constructor.tsx"] = { fg = C.lavender },
["@tag.attribute.tsx"] = { fg = C.teal, style = { "italic" } },
["@tag.attribute.tsx"] = { fg = C.teal, style = O.styles.miscs or { "italic" } },

-- yaml
["@variable.member.yaml"] = { fg = C.blue }, -- For fields.
Expand All @@ -184,7 +184,7 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@type.builtin.cpp"] = { fg = C.yellow, style = {} },

-- Misc
gitcommitSummary = { fg = C.rosewater, style = { "italic" } },
gitcommitSummary = { fg = C.rosewater, style = O.styles.miscs or { "italic" } },
zshKSHFunction = { link = "Function" },
}

Expand Down
2 changes: 2 additions & 0 deletions lua/catppuccin/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
---@field types CtpHighlightArgs[]?
-- Change the style of operators.
---@field operators CtpHighlightArgs[]?
-- Change the style of miscs.
---@field miscs CtpHighlightArgs[]?

---@class CtpNativeLspStyles
-- Change the style of LSP errors.
Expand Down

0 comments on commit c0de3b4

Please sign in to comment.