Files
nvim-config/lua/plugins/neo-tree.lua
T
2026-04-26 22:18:42 -05:00

37 lines
1.1 KiB
Lua

return {
"nvim-neo-tree/neo-tree.nvim",
opts = {
window = {
mappings = {
["<cr>"] = function(state)
local node = state.tree:get_node()
if node.type == "directory" then
require("neo-tree.sources.filesystem.commands").toggle_node(state)
else
require("neo-tree.sources.filesystem.commands").open(state)
require("neo-tree.command").execute({ action = "close" })
end
end,
["l"] = function(state)
local node = state.tree:get_node()
if node.type == "directory" then
require("neo-tree.sources.filesystem.commands").toggle_node(state)
else
require("neo-tree.sources.filesystem.commands").open(state)
require("neo-tree.command").execute({ action = "close" })
end
end,
},
},
},
keys = {
{
"<leader>h",
function()
require("neo-tree.command").execute({ action = "focus", source = "filesystem", toggle = true })
end,
desc = "Toggle File Explorer",
},
},
}