Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
70 lines
1.5 KiB
Lua
70 lines
1.5 KiB
Lua
-- Make highlight groups transparent while preserving their other attributes
|
|
local function make_transparent(name)
|
|
local ok, hl = pcall(vim.api.nvim_get_hl, 0, { name = name, link = false })
|
|
if ok then
|
|
hl.bg = nil
|
|
vim.api.nvim_set_hl(0, name, hl)
|
|
end
|
|
end
|
|
|
|
local groups = {
|
|
-- transparent background
|
|
"Normal",
|
|
"NormalFloat",
|
|
"FloatBorder",
|
|
"Pmenu",
|
|
"Terminal",
|
|
"EndOfBuffer",
|
|
"FoldColumn",
|
|
"Folded",
|
|
"SignColumn",
|
|
"LineNr",
|
|
"CursorLineNr",
|
|
"StatusLine",
|
|
"StatusLineNC",
|
|
"NormalNC",
|
|
"WhichKeyFloat",
|
|
"TelescopeBorder",
|
|
"TelescopeNormal",
|
|
"TelescopePromptBorder",
|
|
"TelescopePromptTitle",
|
|
-- neotree
|
|
"NeoTreeNormal",
|
|
"NeoTreeNormalNC",
|
|
"NeoTreeVertSplit",
|
|
"NeoTreeWinSeparator",
|
|
"NeoTreeEndOfBuffer",
|
|
-- nvim-tree
|
|
"NvimTreeNormal",
|
|
"NvimTreeVertSplit",
|
|
"NvimTreeEndOfBuffer",
|
|
-- notify
|
|
"NotifyINFOBody",
|
|
"NotifyERRORBody",
|
|
"NotifyWARNBody",
|
|
"NotifyTRACEBody",
|
|
"NotifyDEBUGBody",
|
|
"NotifyINFOTitle",
|
|
"NotifyERRORTitle",
|
|
"NotifyWARNTitle",
|
|
"NotifyTRACETitle",
|
|
"NotifyDEBUGTitle",
|
|
"NotifyINFOBorder",
|
|
"NotifyERRORBorder",
|
|
"NotifyWARNBorder",
|
|
"NotifyTRACEBorder",
|
|
"NotifyDEBUGBorder",
|
|
}
|
|
|
|
-- The current line goes see-through too, leaving its number to mark it. The
|
|
-- file tree marks its selection with that line alone, so it keeps the colour.
|
|
local cursorline = vim.api.nvim_get_hl(0, { name = "CursorLine", link = false })
|
|
if cursorline.bg then
|
|
vim.api.nvim_set_hl(0, "NeoTreeCursorLine", { bg = cursorline.bg })
|
|
end
|
|
table.insert(groups, "CursorLine")
|
|
|
|
for _, name in ipairs(groups) do
|
|
make_transparent(name)
|
|
end
|