Call sudo
in yazi.
Until now (2024-08-25) ya pack
still don't support installing scripts other than lua,
so you need to run the following command:
$ git clone https://github.com/TD-Sky/sudo.yazi.git ~/.config/yazi/plugins/sudo.yazi
- copy files
- move files
- rename file
- trash files
- remove files
- create absolute-path symbolic links
- create relative-path symbolic links
- touch new file
- make new directory
You can use conceal to browse and restore trashed files
Here are my own keymap for reference only:
# sudo cp/mv
[[manager.keymap]]
on = ["R", "p", "p"]
run = "plugin sudo --args='paste'"
desc = "sudo paste"
# sudo cp/mv --force
[[manager.keymap]]
on = ["R", "P"]
run = "plugin sudo --args='paste -f'"
desc = "sudo paste"
# sudo mv
[[manager.keymap]]
on = ["R", "r"]
run = "plugin sudo --args='rename'"
desc = "sudo rename"
# sudo ln -s (absolute-path)
[[manager.keymap]]
on = ["R", "p", "l"]
run = "plugin sudo --args='link'"
desc = "sudo link"
# sudo ln -s (relative-path)
[[manager.keymap]]
on = ["R", "p", "L"]
run = "plugin sudo --args='link -r'"
desc = "sudo link relative path"
# sudo touch/mkdir
[[manager.keymap]]
on = ["R", "a"]
run = "plugin sudo --args='create'"
desc = "sudo create"
# sudo trash
[[manager.keymap]]
on = ["R", "d"]
run = "plugin sudo --args='remove'"
desc = "sudo trash"
# sudo delete
[[manager.keymap]]
on = ["R", "D"]
run = "plugin sudo --args='remove -P'"
desc = "sudo delete"