Skip to content

TD-Sky/sudo.yazi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sudo.yazi

Call sudo in yazi.

Installation

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

Requirements

Functions

  • 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

Usage

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"

About

Call `sudo` in yazi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published