fix(nvim-tree): disable hl groups in onedark instead

This commit is contained in:
2026-05-06 23:38:41 +02:00
parent c4e96e359c
commit 77025b72c0
2 changed files with 4 additions and 40 deletions
-39
View File
@@ -1,39 +1,3 @@
local util = require("util")
local function override_highlights()
-- File Icon
local hl = util.get_hl_source("NvimTreeFileIcon")
vim.api.nvim_set_hl(0, "NvimTreeFileIcon", { fg = hl.fg, bg = nil })
-- Symlink Icon
hl = util.get_hl_source("NvimTreeSymlinkIcon")
vim.api.nvim_set_hl(0, "NvimTreeSymlinkIcon", { fg = hl.fg, bg = nil })
end
local function disable_highlights()
-- File types
vim.cmd.highlight({ "clear NvimTreeExecFile" })
vim.cmd.highlight({
"link NvimTreeExecFile NONE",
bang = true,
})
vim.cmd.highlight({ "clear NvimTreeImageFile" })
vim.cmd.highlight({
"link NvimTreeImageFile NONE",
bang = true,
})
vim.cmd.highlight({ "clear NvimTreeSpecialFile" })
vim.cmd.highlight({
"link NvimTreeSpecialFile NONE",
bang = true,
})
vim.cmd.highlight({ "clear NvimTreeSymlink" })
vim.cmd.highlight({
"link NvimTreeSymlink NONE",
bang = true,
})
end
vim.keymap.set("n", "<leader>tt", function() vim.keymap.set("n", "<leader>tt", function()
require("nvim-tree.api").tree.toggle({ find_file = true, focus = false }) require("nvim-tree.api").tree.toggle({ find_file = true, focus = false })
end) end)
@@ -264,9 +228,6 @@ require("nvim-tree").setup({
}, },
}) })
override_highlights()
disable_highlights()
vim.api.nvim_create_autocmd("QuitPre", { vim.api.nvim_create_autocmd("QuitPre", {
callback = function() callback = function()
local tree_wins = {} local tree_wins = {}
+4 -1
View File
@@ -44,7 +44,10 @@ local highlights = {
TabLineSel = { fg = c.fg, bg = c.bg2 }, TabLineSel = { fg = c.fg, bg = c.bg2 },
TabLineFill = { bg = c.bg1 }, TabLineFill = { bg = c.bg1 },
EndOfBuffer = { fg = "NONE", bg = "NONE" }, EndOfBuffer = { fg = "NONE", bg = "NONE" },
NvimTreeIndentMarker = { fg = c.bg3 }, NvimTreeExecFile = { fg = "NONE", bg = "NONE" },
NvimTreeSpecialFile = { fg = "NONE", bg = "NONE" },
NvimTreeSymlink = { fg = "NONE", bg = "NONE" },
NvimTreeImageFile = { fg = "NONE", bg = "NONE" },
TelescopeNormal = { bg = c.bg_d }, TelescopeNormal = { bg = c.bg_d },
TelescopeTitle = { fg = c.orange, bg = c.bg_d }, TelescopeTitle = { fg = c.orange, bg = c.bg_d },
TelescopePromptBorder = { fg = c.grey, bg = c.bg_d }, TelescopePromptBorder = { fg = c.grey, bg = c.bg_d },