341e83f6f2b45c80a4c555f1a0f04ff6acbc15b9
- Author
- naegi <gouge.tristan@gmail.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Plugin : Sudo - Add support of sudoedit (#5035)
* Add sudoedit support
* change describtion of sudo plugin
Diff
1diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh
2index 0ba8bed5be790fb1daf2749da215d275bf71add3..0b843822ea249952a4a0a0e81f7db29a0100a835 100644
3--- a/plugins/sudo/sudo.plugin.zsh
4+++ b/plugins/sudo/sudo.plugin.zsh
5@@ -2,7 +2,7 @@
6 # Description
7 # -----------
8 #
9-# sudo will be inserted before the command
10+# sudo or sudoedit will be inserted before the command
11 #
12 # ------------------------------------------------------------------------------
13 # Authors
14@@ -16,6 +16,12 @@ sudo-command-line() {
15 [[ -z $BUFFER ]] && zle up-history
16 if [[ $BUFFER == sudo\ * ]]; then
17 LBUFFER="${LBUFFER#sudo }"
18+ elif [[ $BUFFER == $EDITOR\ * ]]; then
19+ LBUFFER="${LBUFFER#$EDITOR }"
20+ LBUFFER="sudoedit $LBUFFER"
21+ elif [[ $BUFFER == sudoedit\ * ]]; then
22+ LBUFFER="${LBUFFER#sudoedit }"
23+ LBUFFER="$EDITOR $LBUFFER"
24 else
25 LBUFFER="sudo $LBUFFER"
26 fi