feat(neo-tree): add h/l navigation and open file support

This commit is contained in:
dotfrag 2024-05-23 19:15:51 +03:00
parent 0f6ff53ce3
commit 7c74d1d5f5

View file

@ -87,6 +87,26 @@ return {
end,
desc = "Open with System Application",
},
["h"] = function(state)
local node = state.tree:get_node()
if node:has_children() and node:is_expanded() then
state.commands.toggle_node(state)
else
require("neo-tree.ui.renderer").focus_node(state, node:get_parent_id())
end
end,
["l"] = function(state)
local node = state.tree:get_node()
if node:has_children() then
if not node:is_expanded() then
state.commands.toggle_node(state)
else
require("neo-tree.ui.renderer").focus_node(state, node:get_child_ids()[1])
end
else
state.commands.open(state)
end
end,
},
},
default_component_configs = {