From 918a78cfdb92b9301168cb9d62d8ddbbdfd907f6 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 16 Sep 2018 20:16:16 +0200 Subject: man: rename file to *.plugin.zsh (#6016) Also fixed minor typo Closes #6108 Co-authored-by: Matt --- plugins/man/man.plugin.zsh | 27 +++++++++++++++++++++++++++ plugins/man/man.zsh | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 plugins/man/man.plugin.zsh delete mode 100644 plugins/man/man.zsh (limited to 'plugins/man') diff --git a/plugins/man/man.plugin.zsh b/plugins/man/man.plugin.zsh new file mode 100644 index 000000000..94aa4918d --- /dev/null +++ b/plugins/man/man.plugin.zsh @@ -0,0 +1,27 @@ +# ------------------------------------------------------------------------------ +# Author +# ------ +# +# * Jerry Ling +# +# ------------------------------------------------------------------------------ +# 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 diff --git a/plugins/man/man.zsh b/plugins/man/man.zsh deleted file mode 100644 index 3490b0b61..000000000 --- a/plugins/man/man.zsh +++ /dev/null @@ -1,27 +0,0 @@ -# ------------------------------------------------------------------------------ -# Author -# ------ -# -# * Jerry Ling -# -# ------------------------------------------------------------------------------ -# 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 -- cgit v1.2.3-70-g09d2 From 530759d5a07a73b627aa30d2322b4a2701855bf3 Mon Sep 17 00:00:00 2001 From: Jeffrey Chandler <36927673+jeff-chandler@users.noreply.github.com> Date: Fri, 12 Oct 2018 15:43:55 -0400 Subject: Added a README file for the man plugin --- plugins/man/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/man/README.md (limited to 'plugins/man') diff --git a/plugins/man/README.md b/plugins/man/README.md new file mode 100644 index 000000000..0fd3fead2 --- /dev/null +++ b/plugins/man/README.md @@ -0,0 +1,13 @@ +# Man plugin + +This plugin adds a shortcut to insert man before the previous command. + +To use it, add `man` to the plugins array in your zshrc file: + +```zsh +plugins=(... man) +``` +# Keyboard Shortcuts +| Shortcut | Description | +|-----------------------------------|------------------------------------------------------------------------| +| esc + man | add man before the previous command to see the manual for this command | -- cgit v1.2.3-70-g09d2 From 4a5fa087b89c5f26d93c610147db478b78efae4d Mon Sep 17 00:00:00 2001 From: Jeffrey Chandler <36927673+jeff-chandler@users.noreply.github.com> Date: Fri, 12 Oct 2018 15:54:31 -0400 Subject: Updated keybinding syntax --- plugins/man/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/man') diff --git a/plugins/man/README.md b/plugins/man/README.md index 0fd3fead2..4601252c0 100644 --- a/plugins/man/README.md +++ b/plugins/man/README.md @@ -10,4 +10,4 @@ plugins=(... man) # Keyboard Shortcuts | Shortcut | Description | |-----------------------------------|------------------------------------------------------------------------| -| esc + man | add man before the previous command to see the manual for this command | +| Esc + man | add man before the previous command to see the manual for this command | -- cgit v1.2.3-70-g09d2