8b53d0494241fe044e44e24515f7c6293717557e

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

docs(sudo): document key binding change

Diff

 1diff --git a/plugins/sudo/README.md b/plugins/sudo/README.md
 2index 4f3973ef827084a1d31586c29ae143f88eed8282..012fc53254c7097501f7e71b7f7a1a666bdf11e3 100644
 3--- a/plugins/sudo/README.md
 4+++ b/plugins/sudo/README.md
 5@@ -1,6 +1,6 @@
 6 # sudo
 7 
 8-Easily prefix your current or previous commands with `sudo` by pressing <kbd>esc</kbd> twice
 9+Easily prefix your current or previous commands with `sudo` by pressing <kbd>esc</kbd> twice.
10 
11 To use it, add `sudo` to the plugins array in your zshrc file:
12 
13@@ -43,3 +43,17 @@ $ sudo rm some-system-file.txt
14 Password:
15 $
16 ```
17+
18+## Key binding
19+
20+By default, the `sudo` plugin uses <kbd>Esc</kbd><kbd>Esc</kbd> as the trigger.
21+If you want to change it, you can use the `bindkey` command to bind it to a different key:
22+
23+```sh
24+bindkey -M emacs '<seq>' sudo-command-line
25+bindkey -M vicmd '<seq>' sudo-command-line
26+bindkey -M viins '<seq>' sudo-command-line
27+```
28+
29+where `<seq>` is the sequence you want to use. You can find the keyboard sequence
30+by running `cat` and pressing the keyboard combination you want to use.