mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
Antigen is a broken piece of shit
This commit is contained in:
19
.config/zsh/plugins/sudo.zsh
Normal file
19
.config/zsh/plugins/sudo.zsh
Normal file
@ -0,0 +1,19 @@
|
||||
# Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/sudo/sudo.plugin.zsh
|
||||
|
||||
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
|
||||
}
|
||||
zle -N sudo-command-line
|
||||
# Defined shortcut keys: [Esc] [Esc]
|
||||
bindkey "\e\e" sudo-command-line
|
Reference in New Issue
Block a user