Skip to content

Commit

Permalink
fix(config): change styles to match with names of colorset colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ramojus committed Aug 25, 2024
1 parent 30b7ddc commit 7e0cc3e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
18 changes: 7 additions & 11 deletions lua/mellifluous/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,18 @@ local function get_default_config()
},
dim_inactive = false,
styles = {
comments = { italic = true },
conditionals = {},
folds = {},
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
main_keywords = {},
other_keywords = {},
types = {},
operators = {},
strings = {},
functions = {},
constants = {},
comments = { italic = true },
markup = {
headings = { bold = true },
},
folds = {},
},
transparent_background = {
enabled = false,
Expand Down
2 changes: 1 addition & 1 deletion lua/mellifluous/highlights/custom_groups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function M.get(colors)
local shader = require("mellifluous.utils.shader")

return {
MainKeyword = { fg = colors.main_keywords, style = config.styles.keywords },
MainKeyword = { fg = colors.main_keywords, style = config.styles.main_keywords or {} },

IndentLine = function(bg)
bg = fallback_if_none(bg, colors.bg)
Expand Down
16 changes: 8 additions & 8 deletions lua/mellifluous/highlights/general.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,23 @@ function M.set(hl, colors)
--
-- Uncomment and edit if you want more specific syntax highlighting.
hl.set("Comment", { fg = colors.comments, style = config.styles.comments or {} }) -- Any comment
hl.set("Constant", { fg = colors.constants }) -- (*) Any constant
hl.set("Constant", { fg = colors.constants, style = config.styles.constants or {} } ) -- (*) Any constant
hl.set("String", { fg = colors.strings, style = config.styles.strings or {} }) -- A string constant: 'this is a string'
hl.set("Character", { fg = hl.get("String").fg }) -- A character constant: 'c', '\n'
hl.set("Number", { link = "Constant", style = config.styles.numbers or {} }) -- A number constant: 234, 0xff
hl.set("Boolean", { link = "Constant", style = config.styles.booleans or {} }) -- A boolean constant: TRUE, false
hl.set("Float", { link = "Constant", style = config.styles.numbers or {} }) -- A floating point constant: 2.3e10
hl.set("Identifier", { fg = colors.fg, style = config.styles.variables or {} }) -- (*) Any variable name
hl.set("Number", { link = "Constant" }) -- A number constant: 234, 0xff
hl.set("Boolean", { link = "Constant" }) -- A boolean constant: TRUE, false
hl.set("Float", { link = "Constant" }) -- A floating point constant: 2.3e10
hl.set("Identifier", { fg = colors.fg }) -- (*) Any variable name
hl.set("Function", { fg = colors.functions, style = config.styles.functions or {} }) -- Function name (also: methods for classes)
hl.set("Statement", { link = "Keyword" }) -- (*) Any statement
hl.set("Conditional", { fg = colors.main_keywords, style = config.styles.conditionals or {} }) -- if, then, else, endif, switch, etc.
hl.set("Repeat", { fg = colors.main_keywords, style = config.styles.loops or {} }) -- for, do, while, etc.
hl.set("Conditional", groups.MainKeyword) -- if, then, else, endif, switch, etc.
hl.set("Repeat", groups.MainKeyword) -- for, do, while, etc.
hl.set("Label", { fg = colors.other_keywords })
hl.set("Operator", {
fg = config.is_bg_dark and colors.operators or colors.fg3,
style = config.styles.operators or {},
}) -- 'sizeof', '+', '*', etc.
hl.set("Keyword", { fg = colors.other_keywords, style = config.styles.keywords }) -- any other keyword
hl.set("Keyword", { fg = colors.other_keywords, style = config.styles.other_keywords }) -- any other keyword
hl.set("Exception", groups.MainKeyword) -- try, catch, throw
hl.set("PreProc", { fg = colors.functions }) -- (*) Generic Preprocessor
hl.set("Include", { link = "PreProc" }) -- Preprocessor #include
Expand Down
2 changes: 1 addition & 1 deletion lua/mellifluous/highlights/plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function M.set(hl, colors)
hl.set("@variable.builtin", { fg = colors.other_keywords }) -- Variable names defined by the language: `this` or `self` in Javascript.
hl.set("@variable.parameter", { fg = colors.fg }) -- Parameters of a function.
hl.set("@variable.parameter.reference", { link = "@variable.parameter" }) -- References to parameters of a function.
hl.set("@variable.member", { fg = colors.fg, style = config.styles.properties }) -- Object and struct fields.
hl.set("@variable.member", { fg = colors.fg }) -- Object and struct fields.
hl.set("@constant", { link = "Constant" }) -- Constants identifiers. These might not be semantically constant. E.g. uppercase variables in Python.
hl.set("@constant.builtin", { link = "Constant" }) -- Built-in constant values: `nil` in Lua.
hl.set("@constant.macro", { link = "Constant" }) -- Constants defined by macros: `NULL` in C.
Expand Down

0 comments on commit 7e0cc3e

Please sign in to comment.