Skip to content

Commit

Permalink
feat(syntax): respect style guide part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchilly committed Aug 26, 2023
1 parent 2e3e5eb commit 3ce8ee2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lua/catppuccin/groups/integrations/aerial.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function M.get()
AerialNamespaceIcon = { link = "@namespace" },
AerialNumberIcon = { link = "@number" },
AerialOperatorIcon = { link = "@operator" },
AerialTypeParameterIcon = { link = "@parameter" },
AerialTypeParameterIcon = { link = "@type" },
AerialPropertyIcon = { link = "@property" },
AerialStringIcon = { link = "@string" },
AerialVariableIcon = { link = "@constant" },
Expand Down
2 changes: 1 addition & 1 deletion lua/catppuccin/groups/integrations/lsp_saga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function M.get()
LspKindPackage = { fg = C.blue },
LspKindProperty = { fg = C.teal },
LspKindStruct = { fg = C.yellow },
LspKindTypeParameter = { fg = C.maroon },
LspKindTypeParameter = { fg = C.blue },
LspKindVariable = { fg = C.peach },
LspKindArray = { fg = C.peach },
LspKindBoolean = { fg = C.peach },
Expand Down
47 changes: 28 additions & 19 deletions lua/catppuccin/groups/integrations/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@operator"] = { link = "Operator" }, -- For any operator: +, but also -> and * in C.

-- Punctuation
["@punctuation.delimiter"] = { link = "Delimiter" }, -- For delimiters ie: .
["@punctuation.delimiter"] = { link = "Delimiter" }, -- For delimiters (e.g. `;` / `.` / `,`).
["@punctuation.bracket"] = { fg = C.overlay2 }, -- For brackets and parenthesis.
["@punctuation.special"] = { link = "Special" }, -- For special punctutation that does not fall in the categories before.
["@punctuation.special"] = { link = "Special" }, -- For special punctuation that does not fall in the categories before (e.g. `{}` in string interpolation).

-- Literals
["@string"] = { link = "String" }, -- For strings.
Expand All @@ -43,21 +43,20 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@function"] = { link = "Function" }, -- For function (calls and definitions).
["@function.builtin"] = { fg = C.peach, style = O.styles.functions or {} }, -- For builtin functions: table.insert in Lua.
["@function.call"] = { link = "Function" }, -- function calls
["@function.macro"] = { fg = C.teal, style = O.styles.functions or {} }, -- For macro defined functions (calls and definitions): each macro_rules in RusC.
["@method"] = { link = "Function" }, -- For method calls and definitions.

["@method.call"] = { link = "Function" }, -- method calls
["@function.macro"] = { fg = C.teal, style = O.styles.functions or {} }, -- For macro defined functions (calls and definitions): each macro_rules in Rust.
["@method"] = { link = "Function" }, -- For method definitions.
["@method.call"] = { link = "Function" }, -- For method calls.

["@constructor"] = { fg = C.sapphire }, -- For constructor calls and definitions: = { } in Lua, and Java constructors.
["@parameter"] = { fg = C.maroon, style = { "italic" } }, -- For parameters of a function.
["@parameter"] = { fg = C.maroon, style = O.styles.variables or {} }, -- For parameters of a function.

-- Keywords
["@keyword"] = { link = "Keyword" }, -- For keywords that don't fall in previous categories.
["@keyword.function"] = { fg = C.mauve, style = O.styles.keywords or {} }, -- For keywords used to define a function.
["@keyword.operator"] = { fg = C.mauve, style = O.styles.operators or {} }, -- For new keyword operator
["@keyword.return"] = { fg = C.mauve, style = O.styles.keywords or {} },
-- JS & derivative
["@keyword.export"] = { fg = C.sky, style = { "bold" } },
["@keyword.export"] = { fg = C.sky, style = O.styles.keywords },

["@conditional"] = { link = "Conditional" }, -- For keywords related to conditionnals.
["@repeat"] = { link = "Repeat" }, -- For keywords related to loops.
Expand All @@ -69,9 +68,9 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
-- Types

["@type"] = { link = "Type" }, -- For types.
["@type.builtin"] = { fg = C.yellow, style = O.styles.properties or "italic" }, -- For builtin types.
["@type.definition"] = { link = "@type" }, -- type definitions (e.g. `typedef` in C)
["@type.qualifier"] = { link = "@type" }, -- type qualifiers (e.g. `const`)
["@type.builtin"] = { fg = C.yellow, style = O.styles.properties or { "italic" } }, -- For builtin types.
["@type.definition"] = { link = "Type" }, -- type definitions (e.g. `typedef` in C)
["@type.qualifier"] = { link = "Keyword" }, -- type qualifiers (e.g. `const`)

["@storageclass"] = { link = "StorageClass" }, -- visibility/life-time/etc. modifiers (e.g. `static`)
["@attribute"] = { link = "Constant" }, -- attribute annotations (e.g. Python decorators)
Expand All @@ -81,7 +80,7 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
-- Identifiers

["@variable"] = { fg = C.text, style = O.styles.variables or {} }, -- Any variable name that does not have another highlight.
["@variable.builtin"] = { fg = C.red }, -- Variable names that are defined by the languages, like this or self.
["@variable.builtin"] = { fg = C.red, style = O.styles.properties or {} }, -- Variable names that are defined by the languages, like this or self.

["@constant"] = { link = "Constant" }, -- For constants
["@constant.builtin"] = { fg = C.peach, style = O.styles.keywords or {} }, -- For constant that are built in the language: nil in Lua.
Expand All @@ -91,7 +90,6 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@symbol"] = { fg = C.flamingo },

-- Text

["@text"] = { fg = C.text }, -- For strings considerated text in a markup language.
["@text.strong"] = { fg = C.maroon, style = { "bold" } }, -- bold
["@text.emphasis"] = { fg = C.maroon, style = { "italic" } }, -- italic
Expand All @@ -103,7 +101,7 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@text.math"] = { fg = C.blue }, -- math environments (e.g. `$ ... $` in LaTeX)
["@text.environment"] = { fg = C.pink }, -- text environments of markup languages
["@text.environment.name"] = { fg = C.blue }, -- text indicating the type of an environment
["@text.reference"] = { fg = C.lavender, style = { "bold" } }, -- references
["@text.reference"] = { link = "Tag" }, -- text references, footnotes, citations, etc.

["@text.todo"] = { fg = C.base, bg = C.yellow }, -- todo notes
["@text.todo.checked"] = { fg = C.green }, -- todo notes
Expand All @@ -121,6 +119,8 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@tag.delimiter"] = { fg = C.sky }, -- Tag delimiter like < > /

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

-- markdown
["@text.title.2.markdown"] = { link = "rainbow2" },
Expand All @@ -130,6 +130,9 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@text.title.5.markdown"] = { link = "rainbow5" },
["@text.title.6.markdown"] = { link = "rainbow6" },

-- java
["@constant.java"] = { fg = C.teal },

-- css
["@property.css"] = { fg = C.lavender },
["@property.id.css"] = { fg = C.blue },
Expand All @@ -146,28 +149,34 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@label.json"] = { fg = C.blue }, -- For labels: label: in C and :label: in Lua.

-- lua
["@constructor.lua"] = { fg = C.flamingo }, -- For constructor calls and definitions: = { } in Lua, and Java constructors.
["@constructor.lua"] = { fg = C.flamingo }, -- For constructor calls and definitions: = { } in Lua.

-- typescript
["@property.typescript"] = { fg = C.lavender, style = O.styles.properties or {} },
["@constructor.typescript"] = { fg = C.lavender },

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

-- cpp
["@property.cpp"] = { fg = C.rosewater },

-- yaml
["@field.yaml"] = { fg = C.blue }, -- For fields.

-- Ruby
["@symbol.ruby"] = { fg = C.flamingo },

-- PHP
["@type.qualifier.php"] = { link = "Keyword" }, -- type qualifiers (e.g. `const`)
["@method.php"] = { link = "Function" },
["@method.call.php"] = { link = "Function" },

-- C/CPP
["@type.builtin.c"] = { fg = C.yellow, style = {} },
["@property.cpp"] = { fg = C.text },
["@type.builtin.cpp"] = { fg = C.yellow, style = {} },

-- Misc
gitcommitSummary = { fg = C.rosewater, style = { "italic" } },
zshKSHFunction = { link = "Function" },
}
end

Expand Down
3 changes: 1 addition & 2 deletions lua/catppuccin/groups/syntax.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function M.get()
Label = { fg = C.sapphire }, -- case, default, etc.
Operator = { fg = C.sky, style = O.styles.operators or {} }, -- "sizeof", "+", "*", etc.
Keyword = { fg = C.mauve, style = O.styles.keywords or {} }, -- any other keyword
Array = { fg = C.lavender },
Exception = { fg = C.mauve, style = O.styles.keywords or {} }, -- try, catch, throw

PreProc = { fg = C.pink }, -- (preferred) generic Preprocessor
Expand All @@ -33,7 +32,7 @@ function M.get()
Type = { fg = C.yellow, style = O.styles.types or {} }, -- (preferred) int, long, char, etc.
Typedef = { link = "Type" }, -- A typedef
SpecialChar = { link = "Special" }, -- special character in a constant
Tag = { link = "Special" }, -- you can use CTRL-] on this
Tag = { fg = C.lavender, style = { "bold" } }, -- you can use CTRL-] on this
Delimiter = { fg = C.overlay2 }, -- character that needs attention
Debug = { link = "Special" }, -- debugging statements

Expand Down

0 comments on commit 3ce8ee2

Please sign in to comment.