Skip to content
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

feat(settings): allow customization of transparent_background #687

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ settings["palette_overwrite"] = {}
---@type string
settings["colorscheme"] = "catppuccin"

-- Set it to true if your terminal has transparent background.
---@type boolean
settings["transparent_background"] = false

-- Set background color to use here.
-- Useful if you would like to use a colorscheme that has a light and dark variant like `edge`.
-- Valid values are: `dark`, `light`.
Expand Down
4 changes: 1 addition & 3 deletions lua/modules/configs/ui/catppuccin.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
return function()
local transparent_background = false -- Set background transparency here!

require("catppuccin").setup({
flavour = "mocha", -- Can be one of: latte, frappe, macchiato, mocha
background = { light = "latte", dark = "mocha" },
Expand All @@ -11,7 +9,7 @@ return function()
shade = "dark",
percentage = 0.15,
},
transparent_background = transparent_background,
transparent_background = require("core.settings").transparent_background,
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
term_colors = true,
compile_path = vim.fn.stdpath("cache") .. "/catppuccin",
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/configs/ui/edge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ return function()
vim.g.edge_disable_italic_comment = 1
vim.g.edge_show_eob = 1
vim.g.edge_better_performance = 1
vim.g.edge_transparent_background = 1
vim.g.edge_transparent_background = require("core.settings").transparent_background and 2 or 0
end
2 changes: 1 addition & 1 deletion lua/modules/configs/ui/nord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ return function()
vim.g.nord_contrast = true
vim.g.nord_borders = false
vim.g.nord_cursorline_transparent = true
vim.g.nord_disable_background = false
vim.g.nord_disable_background = require("core.settings").transparent_background
vim.g.nord_enable_sidebar_background = true
vim.g.nord_italic = true
end