This commit is contained in:
philosophos 2017-06-08 08:35:20 +00:00 committed by GitHub
commit 0357020d49

View file

@ -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