-
I don't know if this is possible, or advised. Suppose I have many files, and I want to move them into subfolders of the current directory based on some criteria. So I select the files to be moved. Then I navigate to where the folder name is in the list, and open it. And then paste. What I'd like to be able to do would be to navigate to the folder in the list, and paste without opening it. So it should paste in the current folder if a folder isn't selected, and paste in the subfolder if a subfolder is selected. Or even maybe have a keymap that pastes it in the subfolder? Would this be possible to set up? At the moment, I keep forgetting to open the subfolder, and then it makes copies rather than moving it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
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 { on = [ "p" ], run = "plugin --sync smart-paste" } demo.mp4 |
Beta Was this translation helpful? Give feedback.
-
And if you want to force overwrite this works: return { |
Beta Was this translation helpful? Give feedback.
It's possible, you can write a plugin in a few lines of code to achieve it:
Save it as
~/.config/yazi/plugins/smart-paste.yazi/init.lua
, then bind it to thep
key in yourkeymap.toml
:demo.mp4