addet smart enter snippet for 'l'
This commit is contained in:
parent
6d68da8217
commit
ab075c85f7
2 changed files with 13 additions and 1 deletions
|
@ -34,7 +34,7 @@ keymap = [
|
||||||
|
|
||||||
# Navigation
|
# Navigation
|
||||||
{ on = "h", run = "leave", desc = "Go back to the parent directory" },
|
{ on = "h", run = "leave", desc = "Go back to the parent directory" },
|
||||||
{ on = "l", run = "enter", desc = "Enter the child directory" },
|
# { on = "l", run = "enter", desc = "Enter the child directory" },
|
||||||
|
|
||||||
{ on = "<Left>", run = "leave", desc = "Go back to the parent directory" },
|
{ on = "<Left>", run = "leave", desc = "Go back to the parent directory" },
|
||||||
{ on = "<Right>", run = "enter", desc = "Enter the child directory" },
|
{ on = "<Right>", run = "enter", desc = "Enter the child directory" },
|
||||||
|
@ -327,3 +327,8 @@ keymap = [
|
||||||
on = "!"
|
on = "!"
|
||||||
run = 'shell "$SHELL" --block --confirm'
|
run = 'shell "$SHELL" --block --confirm'
|
||||||
desc = "Open shell here"
|
desc = "Open shell here"
|
||||||
|
|
||||||
|
[[manager.prepend_keymap]]
|
||||||
|
on = "l"
|
||||||
|
run = "plugin --sync smart-enter"
|
||||||
|
desc = "Enter the child directory, or open the file"
|
||||||
|
|
7
plugins/smart-enter.yazi/init.lua
Normal file
7
plugins/smart-enter.yazi/init.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
--- @sync entry
|
||||||
|
return {
|
||||||
|
entry = function()
|
||||||
|
local h = cx.active.current.hovered
|
||||||
|
ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true })
|
||||||
|
end,
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue