提交 341e83f6 编写于 作者: N naegi 提交者: Robby Russell

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

* Add sudoedit support

* change describtion of sudo plugin
上级 40a9d9cb
......@@ -2,7 +2,7 @@
# Description
# -----------
#
# sudo will be inserted before the command
# sudo or sudoedit will be inserted before the command
#
# ------------------------------------------------------------------------------
# Authors
......@@ -16,6 +16,12 @@ sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
if [[ $BUFFER == sudo\ * ]]; then
LBUFFER="${LBUFFER#sudo }"
elif [[ $BUFFER == $EDITOR\ * ]]; then
LBUFFER="${LBUFFER#$EDITOR }"
LBUFFER="sudoedit $LBUFFER"
elif [[ $BUFFER == sudoedit\ * ]]; then
LBUFFER="${LBUFFER#sudoedit }"
LBUFFER="$EDITOR $LBUFFER"
else
LBUFFER="sudo $LBUFFER"
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册