mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
fix name schema for sudo plugin
Plugin won't load automatically if added to variable $plugins, if name schema different than $name/$name.plugin.zsh is used (see is_plugin() in oh-my-zsh.sh).
This commit is contained in:
parent
a38af27991
commit
b58b996b40
1 changed files with 0 additions and 0 deletions
22
plugins/sudo/sudo.plugin.zsh
Normal file
22
plugins/sudo/sudo.plugin.zsh
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue