commit d143e0f756640594cadf2d5d09a2382750cb8bbc Author: Sebastian Mark Date: Mon Jun 25 22:08:43 2018 +0200 Genesis 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