1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-07 16:00:41 +01:00

man: rename file to *.plugin.zsh (#6016)

Also fixed minor typo

Closes #6108

Co-authored-by: Matt <sifrawr@gmail.com>
This commit is contained in:
Nicolas
2018-09-16 20:16:16 +02:00
committed by Marc Cornellà
parent 4d940109e3
commit 918a78cfdb

View File

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