Skip to content

Commit

Permalink
update yazi plugins for 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
elsesiy committed Dec 18, 2024
1 parent 1ed3f6e commit ae65910
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .config/yazi/keymap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
prepend_keymap = [
{ on = [ "f" ], run = "plugin jump-to-char", desc = "Jumpt to char" },
{ on = [ "F" ], run = "plugin smart-filter", desc = "Smart filter" },
{ on = [ "l" ], run = "plugin --sync smart-enter", desc = "Enter the child directory, or open the file" },
{ on = [ "p" ], run = "plugin --sync smart-paste", desc = "Paste into the hovered directory or CWD" },
{ on = [ "l" ], run = "plugin smart-enter", desc = "Enter the child directory, or open the file" },
{ on = [ "p" ], run = "plugin smart-paste", desc = "Paste into the hovered directory or CWD" },
]
16 changes: 10 additions & 6 deletions .config/yazi/plugins/smart-enter.yazi/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
--- @sync entry

-- source: https://yazi-rs.github.io/docs/tips/#smart-enter
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,
}
local function setup(self, opts) self.open_multi = opts.open_multi end

local function entry(self)
local h = cx.active.current.hovered
ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = not self.open_multi })
end

return { entry = entry, setup = setup }
2 changes: 2 additions & 0 deletions .config/yazi/plugins/smart-paste.yazi/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
--- @sync entry

-- source: https://yazi-rs.github.io/docs/tips/#smart-enter
return {
entry = function()
Expand Down

0 comments on commit ae65910

Please sign in to comment.