mirror of
https://github.com/LazyVim/starter.git
synced 2026-07-25 14:01:03 +00:00
feat: add L and H keymap
This commit is contained in:
parent
16d755f4ff
commit
abe5a68701
1 changed files with 27 additions and 0 deletions
|
|
@ -74,6 +74,33 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
auto_clean_after_session_restore = true,
|
auto_clean_after_session_restore = true,
|
||||||
close_if_last_window = true,
|
close_if_last_window = true,
|
||||||
|
window = {
|
||||||
|
width = 30,
|
||||||
|
mappings = {
|
||||||
|
["h"] = function(state)
|
||||||
|
local node = state.tree:get_node()
|
||||||
|
if node.type == "directory" and node:is_expanded() then
|
||||||
|
require("neo-tree.sources.filesystem").toggle_directory(state, node)
|
||||||
|
else
|
||||||
|
require("neo-tree.ui.renderer").focus_node(state, node:get_parent_id())
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["l"] = function(state)
|
||||||
|
local node = state.tree:get_node()
|
||||||
|
local path = node:get_id()
|
||||||
|
if node.type == "directory" then
|
||||||
|
if not node:is_expanded() then
|
||||||
|
require("neo-tree.sources.filesystem").toggle_directory(state, node)
|
||||||
|
elseif node:has_children() then
|
||||||
|
require("neo-tree.ui.renderer").focus_node(state, node:get_child_ids()[1])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if node.type == "file" then
|
||||||
|
require("neo-tree.utils").open_file(state, path)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue