mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
plugins: Add plugin "sudo"
This commit is contained in:
committed by
Koichi Murase
parent
0e9f0e7e7c
commit
47852f487f
11
plugins/sudo/sudo.plugin.sh
Normal file
11
plugins/sudo/sudo.plugin.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
function _omb_plugin_sudo_add_sudo {
|
||||
if [[ -z $READLINE_LINE ]]; then
|
||||
READLINE_LINE="$(fc -ln -1 | command sed 's/^[[:space:]]\{1,\}//')"
|
||||
fi
|
||||
READLINE_LINE="sudo $READLINE_LINE"
|
||||
((READLINE_POINT += 5))
|
||||
}
|
||||
|
||||
bind -x '"\e\e": _omb_plugin_sudo_add_sudo'
|
||||
Reference in New Issue
Block a user