1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
-- 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",
"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",
}
for _, name in ipairs(groups) do
make_transparent(name)
end
|