Skip to content

Binds double escape to add doas before the command

License

Notifications You must be signed in to change notification settings

anatolykopyl/doas-zsh-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

doas-zsh-plugin

Easily prefix your current or previous commands with doas by pressing esc twice

To use it, run the following command:

$ git clone https://github.com/anatolykopyl/doas-zsh-plugin.git $HOME/.oh-my-zsh/custom/plugins/doas

Usage

Current typed commands

Say you have typed a long command and forgot to add doas in front:

$ apt-get install build-essential

By pressing the esc key twice, you will have the same command with doas prefixed without typing:

$ doas apt-get install build-essential

Previous executed commands

Say you want to delete a system file and denied:

$ rm some-system-file.txt
-su: some-system-file.txt: Permission denied
$

By pressing the esc key twice, you will have the same command with doas prefixed without typing:

$ rm some-system-file.txt
-su: some-system-file.txt: Permission denied
$ doas rm some-system-file.txt
Password:
$

Plugin inspired by sudo plugin by Dongweiming