mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Add sudo plugin which bind \e\e to add sudo in front of the command
This commit is contained in:
parent
cf03ee6d88
commit
c0fb8fba2c
1 changed files with 7 additions and 0 deletions
7
plugins/sudo/sudo.plugin.zsh
Normal file
7
plugins/sudo/sudo.plugin.zsh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
sudo-command-line() {
|
||||
[[ -z "$BUFFER" ]] && zle up-history
|
||||
[[ "$BUFFER" != "sudo *" ]] && BUFFER="sudo $BUFFER"
|
||||
zle end-of-line
|
||||
}
|
||||
zle -N sudo-command-line
|
||||
bindkey '\e\e' sudo-command-line
|
||||
Loading…
Add table
Add a link
Reference in a new issue