mirror of
https://github.com/alvinlollo/Single-install-script.git
synced 2026-07-16 02:42:06 +10:00
Implement sudo last command execution with Control + U
Add functionality to execute the last command with sudo using Control + U.
This commit is contained in:
@@ -109,6 +109,18 @@ update () {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Sudo last command with control + u
|
||||||
|
|
||||||
|
zle -N sudo-last-command-execute
|
||||||
|
sudo-last-command-execute() {
|
||||||
|
|
||||||
|
zle -U $'sudo !!\n'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bind the widget to Control+U
|
||||||
|
bindkey '^U' sudo-last-command-execute
|
||||||
|
|
||||||
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
||||||
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
||||||
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
||||||
|
|||||||
Reference in New Issue
Block a user