Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
341e83f6
Commit
341e83f6
authored
Aug 15, 2016
by
naegi
Committed by
Robby Russell
Aug 14, 2016
Browse files
Plugin : Sudo - Add support of sudoedit (#5035)
* Add sudoedit support * change describtion of sudo plugin
parent
40a9d9cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/sudo/sudo.plugin.zsh
View file @
341e83f6
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment