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