readme(transparent): Add custom_highlights direction (#201)

fix(transparent): Add FAQ
dev
Null Chilly 2 years ago committed by GitHub
parent cbbbdc9619
commit 8689cd8ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -458,11 +458,30 @@ vim.api.nvim_create_autocmd("User", {
## FAQ ## FAQ
#### [Abnormal colors](https://github.com/catppuccin/nvim/issues/182)? #### Transparenct background tweak?
Add this to `custom_highlights` settings
```lua
custom_highlights = {
Comment = { fg = colors.overlay1 },
LineNr = { fg = colors.overlay1 },
CursorLine = { bg = colors.none },
CursorLineNr = { fg = colors.lavender },
DiagnosticVirtualTextError = { bg = colors.none },
DiagnosticVirtualTextWarn = { bg = colors.none },
DiagnosticVirtualTextInfo = { bg = colors.none },
DiagnosticVirtualTextHint = { bg = colors.none },
},
```
#### Abnormal colors?
You need to enable [truecolor](https://wiki.archlinux.org/title/Color_output_in_console#True_color_support) You need to enable [truecolor](https://wiki.archlinux.org/title/Color_output_in_console#True_color_support)
#### Toggle light/dark theme based on background value? Related: [:h termguicolors](https://neovim.io/doc/user/options.html#'termguicolors'), [catppuccin/nvim#182](https://github.com/catppuccin/nvim/issues/182),
#### Use catppuccin theme for :set background=light/dark?
The following autocmd will change the flavour to latte when you `:set background=light` and to mocha after `:set background=dark` The following autocmd will change the flavour to latte when you `:set background=light` and to mocha after `:set background=dark`

@ -24,4 +24,5 @@ function M.get()
TargetWord = { fg = cp.flamingo }, TargetWord = { fg = cp.flamingo },
} }
end end
return M return M

@ -42,9 +42,7 @@ vim.g.colors_name = "catppuccin"]],
table.insert(lines, fmt("vim.o.%s = %s", property, inspect(value))) table.insert(lines, fmt("vim.o.%s = %s", property, inspect(value)))
end end
end end
local tbl = vim.tbl_deep_extend("keep", theme.integrations, theme.editor) local tbl = vim.tbl_deep_extend("keep", config.custom_highlights, theme.integrations, theme.syntax, theme.editor)
tbl = vim.tbl_deep_extend("keep", theme.syntax, tbl)
tbl = vim.tbl_deep_extend("keep", config.custom_highlights, tbl)
for group, color in pairs(tbl) do for group, color in pairs(tbl) do
if color.link then if color.link then

@ -38,10 +38,15 @@ function M.load(theme)
g.colors_name = "catppuccin" g.colors_name = "catppuccin"
M.properties(theme.properties, "o") M.properties(theme.properties, "o")
M.syntax(theme.editor) M.syntax(
M.syntax(theme.syntax) vim.tbl_deep_extend(
M.syntax(theme.integrations) "keep",
M.syntax(require("catppuccin.config").options.custom_highlights) require("catppuccin.config").options.custom_highlights,
theme.integrations,
theme.syntax,
theme.editor
)
)
if require("catppuccin.config").options["term_colors"] then if require("catppuccin.config").options["term_colors"] then
M.properties(theme.terminal, "g") M.properties(theme.terminal, "g")

Loading…
Cancel
Save