pojokcodeid.nvim-lazy/lua/plugins/transparant.lua

66 lines
1.7 KiB
Lua
Raw Normal View History

2024-02-26 08:10:39 +07:00
local transparent = false
local clear_lualine = false
2024-05-21 19:49:53 +07:00
local transparent_mode = vim.g.pcode_transparent_mode or 0
2024-02-26 08:10:39 +07:00
if transparent_mode ~= nil then
if transparent_mode == 1 then
transparent = true
end
end
2024-05-21 19:49:53 +07:00
local clear_line = vim.g.pcode_clear_lualine or 0
2024-02-26 08:10:39 +07:00
if clear_line ~= nil then
if clear_line == 1 then
clear_lualine = true
end
end
2024-02-23 22:36:52 +07:00
return {
2024-02-24 22:02:53 +07:00
-- transparant config
2024-02-24 22:58:09 +07:00
{
"xiyaowong/transparent.nvim",
2024-03-09 08:06:10 +07:00
lazy = true,
2024-02-26 08:10:39 +07:00
enabled = transparent,
2024-02-24 22:58:09 +07:00
event = "BufWinEnter",
cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" },
config = function()
require("transparent").setup({
extra_groups = {},
exclude_groups = {
-- disable active selection backgroun
"CursorLine",
"CursorLineNR",
"CursorLineSign",
"CursorLineFold",
-- disable nvimtree CursorLine
"NvimTreeCursorLine",
-- disable Neotree CursorLine
"NeoTreeCursorLine",
-- disable Telescope active selection background
"TelescopeSelection",
2024-03-13 19:33:59 +07:00
-- disable lualine background color
"LualineNormal",
2024-02-24 22:58:09 +07:00
},
})
2024-02-26 08:10:39 +07:00
require("transparent").clear_prefix("BufferLine")
-- clear prefix for which-key
require("transparent").clear_prefix("WhichKey")
-- clear prefix for lazy.nvim
require("transparent").clear_prefix("Lazy")
-- clear prefix for NvimTree
require("transparent").clear_prefix("NvimTree")
-- clear prefix for NeoTree
require("transparent").clear_prefix("NeoTree")
2024-03-13 19:33:59 +07:00
-- clear prefix for Telescope
require("transparent").clear_prefix("Telescope")
2024-02-26 08:10:39 +07:00
if clear_lualine then
-- clear prefix for Lualine
require("transparent").clear_prefix("Lualine")
2024-03-13 19:33:59 +07:00
-- create auto command to set transparent
vim.cmd("TransparentDisable")
vim.cmd("TransparentEnable")
2024-02-26 08:10:39 +07:00
end
2024-02-24 22:58:09 +07:00
end,
},
2024-02-23 22:36:52 +07:00
}