diff --git a/dot_config/yazi/keymap.toml b/dot_config/yazi/keymap.toml index 565f13f..076d6a1 100644 --- a/dot_config/yazi/keymap.toml +++ b/dot_config/yazi/keymap.toml @@ -1,7 +1,27 @@ -[mgr] -prepend_keymap = [ - { on = "\\", run = "plugin split-tabs spl_toggle", desc = "Dual-pane: toggle" }, - { on = "", run = "plugin split-tabs spl_switch_tab", desc = "Dual-pane: switch pane" }, - { on = "P", run = "plugin split-tabs spl_preview", desc = "Dual-pane: toggle bottom preview" }, - { on = "", run = "shell -- rofi -theme fullscreen-preview -show filebrowser -filebrowser-command \"ya emit reveal\" -filebrowser-directory \"$(pwd)\"", desc = "Grid view" }, -] +[[mgr.prepend_keymap]] +on = "\\" +run = "plugin split-tabs spl_toggle" +desc = "Dual-pane: toggle" + +[[mgr.prepend_keymap]] +on = "" +run = "plugin split-tabs spl_switch_tab" +desc = "Dual-pane: switch pane" + +[[mgr.prepend_keymap]] +on = "P" +run = "plugin split-tabs spl_preview" +desc = "Dual-pane: toggle bottom preview" + +[[mgr.prepend_keymap]] +on = "" +run = "shell -- rofi -theme fullscreen-preview -show filebrowser -filebrowser-command \"ya emit reveal\" -filebrowser-directory \"$(pwd)\"" +desc = "Grid view" + +[[mgr.prepend_keymap]] +on = "K" +run = "plugin parent-arrow -1" + +[[mgr.prepend_keymap]] +on = "J" +run = "plugin parent-arrow 1" diff --git a/dot_config/yazi/plugins/parent-arrow.yazi/main.lua b/dot_config/yazi/plugins/parent-arrow.yazi/main.lua new file mode 100644 index 0000000..ffcdc50 --- /dev/null +++ b/dot_config/yazi/plugins/parent-arrow.yazi/main.lua @@ -0,0 +1,12 @@ +--- @sync entry +local function entry(_, job) + local parent = cx.active.parent + if not parent then return end + + local target = parent.files[parent.cursor + 1 + job.args[1]] + if target and target.cha.is_dir then + ya.emit("cd", { target.url }) + end +end + +return { entry = entry }