This commit is contained in:
Sebastian Mark 2018-06-25 22:08:43 +02:00
commit d143e0f756
2 changed files with 15 additions and 0 deletions

3
README.md Normal file
View 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
View 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