From b685ac564fe30fb9268fbc76111f675795b19121 Mon Sep 17 00:00:00 2001 From: Anatoly <33553182+anatolykopyl@users.noreply.github.com> Date: Thu, 13 Aug 2020 03:12:57 +0300 Subject: [PATCH] Create README.md --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..907af72 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# doas-zsh-plugin + +Easily prefix your current or previous commands with `doas` by pressing esc 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 esc 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 esc 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)