summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2015-08-30 21:49:07 -0700
committerRobby Russell <robby@planetargon.com>2015-08-30 21:49:07 -0700
commitc1bff7798a833ac795d1a2974147001d9c2ad58f (patch)
tree6e75acc373a04a07c71012ad43771c91f17c689b
parent3f9537767652b6dfd58c57683e752a756537d8f3 (diff)
parentc83575da3fb103af55215835c9e4add2665fbc86 (diff)
downloadzsh-c1bff7798a833ac795d1a2974147001d9c2ad58f.tar.gz
zsh-c1bff7798a833ac795d1a2974147001d9c2ad58f.tar.bz2
zsh-c1bff7798a833ac795d1a2974147001d9c2ad58f.zip
Merge pull request #4195 from jerryling315/master
Add 'man' plugin.
-rw-r--r--plugins/man/man.zsh27
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/man/man.zsh b/plugins/man/man.zsh
new file mode 100644
index 000000000..3490b0b61
--- /dev/null
+++ b/plugins/man/man.zsh
@@ -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 \ No newline at end of file