mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
Customise sudo plugin to fit my aliases
This commit is contained in:
parent
da62525a0b
commit
878b13b2fa
@ -4,11 +4,13 @@ sudo-command-line() {
|
||||
[[ -z $BUFFER ]] && zle up-history
|
||||
if [[ $BUFFER == sudo\ * ]]; then
|
||||
LBUFFER="${LBUFFER#sudo }"
|
||||
elif [[ $BUFFER == $EDITOR\ * ]]; then
|
||||
elif [[ $BUFFER == $EDITOR\ * ]] || [[ $BUFFER == vi\ * ]]; then
|
||||
LBUFFER="${LBUFFER#$EDITOR }"
|
||||
LBUFFER="sudoedit $LBUFFER"
|
||||
elif [[ $BUFFER == sudoedit\ * ]]; then
|
||||
LBUFFER="${LBUFFER#vi }"
|
||||
LBUFFER="svi $LBUFFER"
|
||||
elif [[ $BUFFER == sudoedit\ * ]] || [[ $BUFFER == svi\ * ]]; then
|
||||
LBUFFER="${LBUFFER#sudoedit }"
|
||||
LBUFFER="${LBUFFER#svi }"
|
||||
LBUFFER="$EDITOR $LBUFFER"
|
||||
else
|
||||
LBUFFER="sudo $LBUFFER"
|
||||
|
Loading…
Reference in New Issue
Block a user