c1bff7798a833ac795d1a2974147001d9c2ad58f

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #4195 from jerryling315/master

Add 'man' plugin.

Diff

 1diff --git a/plugins/man/man.zsh b/plugins/man/man.zsh
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..3490b0b61b85ed7c0d6363728f7d4014fb85920d
 4--- /dev/null
 5+++ b/plugins/man/man.zsh
 6@@ -0,0 +1,27 @@
 7+# ------------------------------------------------------------------------------
 8+# Author
 9+# ------
10+#
11+# * Jerry Ling<jerryling315@gmail.com>
12+#
13+# ------------------------------------------------------------------------------
14+# Usgae
15+# -----
16+#
17+# man will be inserted before the command
18+#
19+# ------------------------------------------------------------------------------
20+
21+man-command-line() {
22+    [[ -z $BUFFER ]] && zle up-history
23+    [[ $BUFFER != man\ * ]] && LBUFFER="man $LBUFFER"
24+}
25+zle -N man-command-line
26+# Defined shortcut keys: [Esc]man
27+bindkey "\e"man man-command-line
28+
29+
30+# ------------------------------------------------------------------------------
31+# Also, you might want to use man-preview included in 'osx' plugin
32+# just substitute "man" in the function with "man-preview" after you included OS X in
33+# the .zshrc