Yazi >=0.4 plugin to restore/recover latest deleted files/folders.
Note: Because the "ya.confirm() API" is not fully developed yet, if the file to be restored already exists,
there will be no overwrite confirmation window.
- yazi
- trash-cli
- If you have
Can't Get Trash Directory
error and runningtrash-cli --volumes
in terminal throwAttributeError: 'PrintVolumesList' object has no attribute 'run_action'
. Remove the old version of trash-cli and install newer version How to install.
- If you have
git clone https://github.com/boydaihungst/restore.yazi ~/.config/yazi/plugins/restore.yazi
or
ya pack -a boydaihungst/restore
-
Key binding
-
Add this to your
keymap.toml
:[manager] keymap = [ { on = "u", run = "plugin restore", desc = "Restore last deleted files/folders" }, # or use "d + u" like me { on = ["d", "u"], run = "plugin restore", desc = "Restore last deleted files/folders" }, # ... Other keymaps ]
-
-
Configuration (Optional)
-
Default:
require("restore"):setup({ -- Set the position for confirm and overwrite dialogs. -- don't forget to set height: `h = xx` -- https://yazi-rs.github.io/docs/plugins/utils/#ya.input position = { "center", w = 70, h = 40 }, -- Show confirm dialog before restore. -- NOTE: even if set this to false, overwrite dialog still pop up show_confirm = true, -- colors for confirm and overwrite dialogs theme = { title = "blue", header = "green", -- header color for overwrite dialog header_warning = "yellow", list_item = { odd = "blue", even = "blue" }, }, })
-