diff options
author | Robby Russell <robby@planetargon.com> | 2014-01-28 16:22:14 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2014-01-28 16:22:14 -0800 |
commit | df0305aba511266865b371fa74b94bb3ee321e09 (patch) | |
tree | 2514e60d6fac658462dacf9a846bfdff2a014133 /plugins/sudo/sudo.plugin.zsh | |
parent | d485044169c2ac18e9e8e7fe29f7d4d93864168a (diff) | |
parent | b58b996b40f8de1f030d59336e3594b63ef598ee (diff) | |
download | zsh-df0305aba511266865b371fa74b94bb3ee321e09.tar.gz zsh-df0305aba511266865b371fa74b94bb3ee321e09.tar.bz2 zsh-df0305aba511266865b371fa74b94bb3ee321e09.zip |
Merge pull request #2368 from lumbric/master
fix name schema for sudo plugin
Diffstat (limited to 'plugins/sudo/sudo.plugin.zsh')
-rw-r--r-- | plugins/sudo/sudo.plugin.zsh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh new file mode 100644 index 000000000..d12e06853 --- /dev/null +++ b/plugins/sudo/sudo.plugin.zsh @@ -0,0 +1,22 @@ +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# sudo will be inserted before the command +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Dongweiming <ciici123@gmail.com> +# +# ------------------------------------------------------------------------------ + +sudo-command-line() { +[[ -z $BUFFER ]] && zle up-history +[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER" +zle end-of-line +} +zle -N sudo-command-line +# Defined shortcut keys: [Esc] [Esc] +bindkey "\e\e" sudo-command-line |