-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config with lua functions #244
Comments
I am not sure I like the hl = {
TelescopeBorder = { fg = spec.bg4 }
TelescopeTitle = { fg = spec.fg2, bg = spec.bg4 }
CmpItemKindFunction = { fg = p.magenta.base }
CmpItemKindMethod = { fg = p.magenta.base }
CmpWindowBorder = { fg = spec.bg0, bg = spec.bg0 }
} Seems better to me as an user |
The idea would be that the function would be passed the actual lua tables that nightfox uses. You can then do what you want and reference what you want with that lua table. One of the issues with that is that users can override the entire highlight group table for example. Since this is also just a lua function the user can just deep extend a local table that they create. on_highlight = function(spec, hl, name, color)
local p = spec.palette
local override = {
TelescopeBorder = { fg = spec.bg4 },
TelescopeTitle = { fg = spec.fg2, bg = spec.bg4 },
CmpItemKindFunction = { fg = p.magenta.base },
CmpItemKindMethod = { fg = p.magenta.base },
CmpWindowBorder = { fg = spec.bg0, bg = spec.bg0 },
}
vim.tbl_deep_extend("force", hl, override)
end Maybe instead of modding the actual table the function would expect to return a table that would would then be extended in nightfox. |
Keep in mind that there isn't a As a result I added this https://github.com/catppuccin/nvim/blob/main/lua/catppuccin/lib/vim/init.lua
Yes, that's what I do in catppuccin |
Now that pr #241 has landed I would like to change now nightfox is configured. Instead of having a lua table that you fill in and extend with nightfox I would like to expose this as a lua function instead. Here is a mock up of what a config would look like.
In the example above,
name
would be the name of the style, andcolor
would be nightfox's Color manipulation library.User's configuration is now hashed and cached these functions would only be executed when there is a change to nightfox or the file that the nightfox setup function is called.
The text was updated successfully, but these errors were encountered: