From d143e0f756640594cadf2d5d09a2382750cb8bbc Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Mon, 25 Jun 2018 22:08:43 +0200 Subject: [PATCH] Genesis --- README.md | 3 +++ man.plugin.zsh | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 README.md create mode 100644 man.plugin.zsh diff --git a/README.md b/README.md new file mode 100644 index 0000000..49b8e50 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# man zsh plugin + +prefixes a command with `man` by pressing F1 twice diff --git a/man.plugin.zsh b/man.plugin.zsh new file mode 100644 index 0000000..626b312 --- /dev/null +++ b/man.plugin.zsh @@ -0,0 +1,12 @@ +_man() { + [[ -z $BUFFER ]] && zle up-history + if [[ $BUFFER == man\ * ]]; then + LBUFFER="${LBUFFER#man }" + else + LBUFFER="man $LBUFFER" + fi +} +zle -N _man + +# Defined shortcut keys: [F1][F1] +bindkey "OPOP" _man