mirror of
https://github.com/anatolykopyl/doas-zsh-plugin.git
synced 2026-03-26 12:54:54 +00:00
Create README.md
This commit is contained in:
47
README.md
Normal file
47
README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# doas-zsh-plugin
|
||||
|
||||
Easily prefix your current or previous commands with `doas` by pressing <kbd>esc</kbd> twice
|
||||
|
||||
To use it, run the following command:
|
||||
|
||||
```console
|
||||
$ 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:
|
||||
|
||||
```console
|
||||
$ apt-get install build-essential
|
||||
```
|
||||
|
||||
By pressing the <kbd>esc</kbd> key twice, you will have the same command with `doas` prefixed without typing:
|
||||
|
||||
```console
|
||||
$ doas apt-get install build-essential
|
||||
```
|
||||
|
||||
### Previous executed commands
|
||||
|
||||
Say you want to delete a system file and denied:
|
||||
|
||||
```console
|
||||
$ rm some-system-file.txt
|
||||
-su: some-system-file.txt: Permission denied
|
||||
$
|
||||
```
|
||||
|
||||
By pressing the <kbd>esc</kbd> key twice, you will have the same command with `doas` prefixed without typing:
|
||||
|
||||
```console
|
||||
$ 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](https://github.com/dongweiming)
|
||||
Reference in New Issue
Block a user