2019-01-12 15:47:23 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Author
|
|
|
|
# ------
|
|
|
|
#
|
|
|
|
# * Jerry Ling<jerryling315@gmail.com>
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Usage
|
|
|
|
# -----
|
|
|
|
#
|
|
|
|
# man will be inserted before the command
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
man-command-line() {
|
2020-06-11 14:59:30 +00:00
|
|
|
[[ -z $BUFFER ]] && zle up-history
|
|
|
|
[[ $BUFFER != man\ * ]] && LBUFFER="man $LBUFFER"
|
2019-01-12 15:47:23 +00:00
|
|
|
}
|
|
|
|
zle -N man-command-line
|
|
|
|
# Defined shortcut keys: [Esc]man
|
|
|
|
bindkey "\e"man man-command-line
|
2020-06-11 14:59:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Also, you might want to use man-preview included in 'osx' plugin
|
|
|
|
# just substitute "man" in the function with "man-preview" after you included OS X in
|
|
|
|
# the .zshrc
|