mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
[ESC ESC] - insert sudo in the Begining of line
This commit is contained in:
parent
b908feebcf
commit
791a926bc5
1 changed files with 10 additions and 0 deletions
|
|
@ -91,3 +91,13 @@ bindkey "^[m" copy-prev-shell-word
|
|||
## Fix weird sequence that rxvt produces
|
||||
#bindkey -s '^[[Z' '\t'
|
||||
#
|
||||
|
||||
# [ESC ESC] - insert sudo in the Begining of line
|
||||
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