1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 05:40:08 +00:00

Merge pull request #4195 from jerryling315/master

Add 'man' plugin.
This commit is contained in:
Robby Russell 2015-08-30 21:49:07 -07:00
commit c1bff7798a

27
plugins/man/man.zsh Normal file
View file

@ -0,0 +1,27 @@
# ------------------------------------------------------------------------------
# Author
# ------
#
# * Jerry Ling<jerryling315@gmail.com>
#
# ------------------------------------------------------------------------------
# Usgae
# -----
#
# 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
# the .zshrc