zsh: Show help when hitting K from vi mode

We load the 'run-help' function to quickly show us documentation for the
command under cursor when we enter vi mode and then hit 'K'.
This mimics the actual vim setup where K will generally show
documentation/hover info/help as well.

The command invocation requires an 'even amount of arguments' which I
don't fully understand but have no time to read into and fix currently,
so it just gets another superfluous 'run-help' tacked on at the end.
This commit is contained in:
Marty Oehme 2025-02-26 08:59:08 +01:00
parent e604e34329
commit 19577a7c83
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -4,7 +4,7 @@ CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}"
ZSHCONFDIR="$CONFDIR/zsh"
# load completion, extended zsh moving syntax, zle edit in vim (or other $EDITOR) possibility
autoload -Uz compinit zmv edit-command-line
autoload -Uz compinit zmv edit-command-line run-help run-help-git run-help-ip run-help-sudo
# Set completion style
# The following lines were added by compinstall
@ -232,6 +232,9 @@ zle -N edit-command-line
bindkey '^e' edit-command-line
bindkey -M vicmd '^e' edit-command-line
# give manpage when hitting K from vi mode
bindkey -M vicmd 'K' run-help run-help-git run-help-ip run-help-sudo run-help
# Deduplicate PATH - remove any duplicate entries from PATH
# from: https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command
get_var() {