1
0
mirror of https://github.com/DazAh/dotfiles synced 2026-05-22 02:25:48 +01:00
Files
dotfiles/exact_dot_oh-my-zsh/exact_plugins/exact_man/man.plugin.zsh
T
2019-10-13 01:29:05 +01:00

28 lines
823 B
Bash

# ------------------------------------------------------------------------------
# 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