2015-07-29 12:05:44 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Author
|
|
|
|
# ------
|
|
|
|
#
|
|
|
|
# * Jerry Ling<jerryling315@gmail.com>
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------------
|
2017-05-26 01:20:24 +00:00
|
|
|
# Usage
|
2015-07-29 12:05:44 +00:00
|
|
|
# -----
|
|
|
|
#
|
|
|
|
# man will be inserted before the command
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
man-command-line() {
|
|
|
|
[[ -z $BUFFER ]] && zle up-history
|
|
|
|
[[ $BUFFER != man\ * ]] && LBUFFER="man $LBUFFER"
|
|
|
|
}
|
|
|
|
zle -N man-command-line
|
|
|
|
# Defined shortcut keys: [Esc]man
|
|
|
|
bindkey "\e"man man-command-line
|
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# 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
|
2017-05-26 01:20:24 +00:00
|
|
|
# the .zshrc
|