diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 88fa3392e..a1250fd0e 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -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`. diff --git a/lua/modules/configs/ui/catppuccin.lua b/lua/modules/configs/ui/catppuccin.lua index 3895ca023..6cb07aa21 100644 --- a/lua/modules/configs/ui/catppuccin.lua +++ b/lua/modules/configs/ui/catppuccin.lua @@ -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" }, @@ -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", diff --git a/lua/modules/configs/ui/edge.lua b/lua/modules/configs/ui/edge.lua index 216899a8e..6f63356be 100644 --- a/lua/modules/configs/ui/edge.lua +++ b/lua/modules/configs/ui/edge.lua @@ -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 diff --git a/lua/modules/configs/ui/nord.lua b/lua/modules/configs/ui/nord.lua index 522d3f7c0..17f535539 100644 --- a/lua/modules/configs/ui/nord.lua +++ b/lua/modules/configs/ui/nord.lua @@ -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