Genesis
This commit is contained in:
commit
d143e0f756
2 changed files with 15 additions and 0 deletions
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# man zsh plugin
|
||||
|
||||
prefixes a command with `man` by pressing <kbd>F1</kbd> twice
|
12
man.plugin.zsh
Normal file
12
man.plugin.zsh
Normal file
|
@ -0,0 +1,12 @@
|
|||
_man() {
|
||||
[[ -z $BUFFER ]] && zle up-history
|
||||
if [[ $BUFFER == man\ * ]]; then
|
||||
LBUFFER="${LBUFFER#man }"
|
||||
else
|
||||
LBUFFER="man $LBUFFER"
|
||||
fi
|
||||
}
|
||||
zle -N _man
|
||||
|
||||
# Defined shortcut keys: [F1][F1]
|
||||
bindkey "OPOP" _man
|
Loading…
Reference in a new issue