mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
commit
681c42ac46
1 changed files with 5 additions and 1 deletions
|
@ -14,7 +14,11 @@
|
||||||
|
|
||||||
sudo-command-line() {
|
sudo-command-line() {
|
||||||
[[ -z $BUFFER ]] && zle up-history
|
[[ -z $BUFFER ]] && zle up-history
|
||||||
[[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
|
if [[ $BUFFER == sudo\ * ]]; then
|
||||||
|
LBUFFER="${LBUFFER#sudo }"
|
||||||
|
else
|
||||||
|
LBUFFER="sudo $LBUFFER"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
zle -N sudo-command-line
|
zle -N sudo-command-line
|
||||||
# Defined shortcut keys: [Esc] [Esc]
|
# Defined shortcut keys: [Esc] [Esc]
|
||||||
|
|
Loading…
Reference in a new issue