man/man.plugin.zsh
Sebastian Mark 535b0b8d08 FIX: use non-colliding function name
fixes `_man:3: read-only variable: LBUFFER`
2018-07-13 11:29:43 +02:00

12 lines
273 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

man-command-line() {
[[ -z $BUFFER ]] && zle up-history
if [[ $BUFFER == man\ * ]]; then
LBUFFER="${LBUFFER#man }"
else
LBUFFER="man $LBUFFER"
fi
}
zle -N man-command-line
# Defined shortcut keys: [F1][F1]
bindkey "OPOP" man-command-line