mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Plugin : Sudo - Add support of sudoedit (#5035)
* Add sudoedit support * change describtion of sudo plugin
This commit is contained in:
parent
40a9d9cb91
commit
341e83f6f2
1 changed files with 7 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
# Description
|
# Description
|
||||||
# -----------
|
# -----------
|
||||||
#
|
#
|
||||||
# sudo will be inserted before the command
|
# sudo or sudoedit will be inserted before the command
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Authors
|
# Authors
|
||||||
|
@ -16,6 +16,12 @@ sudo-command-line() {
|
||||||
[[ -z $BUFFER ]] && zle up-history
|
[[ -z $BUFFER ]] && zle up-history
|
||||||
if [[ $BUFFER == sudo\ * ]]; then
|
if [[ $BUFFER == sudo\ * ]]; then
|
||||||
LBUFFER="${LBUFFER#sudo }"
|
LBUFFER="${LBUFFER#sudo }"
|
||||||
|
elif [[ $BUFFER == $EDITOR\ * ]]; then
|
||||||
|
LBUFFER="${LBUFFER#$EDITOR }"
|
||||||
|
LBUFFER="sudoedit $LBUFFER"
|
||||||
|
elif [[ $BUFFER == sudoedit\ * ]]; then
|
||||||
|
LBUFFER="${LBUFFER#sudoedit }"
|
||||||
|
LBUFFER="$EDITOR $LBUFFER"
|
||||||
else
|
else
|
||||||
LBUFFER="sudo $LBUFFER"
|
LBUFFER="sudo $LBUFFER"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue