Skip to content

Paste into selected folder without entering/opening #957

Closed Locked Answered by sxyazi
Kayzels asked this question in 1. Q&A
Discussion options

You must be logged in to vote

It's possible, you can write a plugin in a few lines of code to achieve it:

return {
  entry = function()
    local h = cx.active.current.hovered
    if h and h.cha.is_dir then
      ya.manager_emit("enter", {})
      ya.manager_emit("paste", {})
      ya.manager_emit("leave", {})
    else
      ya.manager_emit("paste", {})
    end
  end,
}

Save it as ~/.config/yazi/plugins/smart-paste.yazi/init.lua, then bind it to the p key in your keymap.toml:

{ on = [ "p" ], run = "plugin --sync smart-paste" }
demo.mp4

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Kayzels
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
3 participants