Commit 341e83f6 authored by naegi's avatar naegi Committed by Robby Russell
Browse files

Plugin : Sudo - Add support of sudoedit (#5035)

* Add sudoedit support

* change describtion of sudo plugin
parent 40a9d9cb
...@@ -2,7 +2,7 @@ ...@@ -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() { ...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment