From 19577a7c837b280e132f723dc044c3a494e2b000 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 26 Feb 2025 08:59:08 +0100 Subject: [PATCH] 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. --- terminal/.config/zsh/.zshrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/terminal/.config/zsh/.zshrc b/terminal/.config/zsh/.zshrc index 9adfdf9..e2b9c87 100644 --- a/terminal/.config/zsh/.zshrc +++ b/terminal/.config/zsh/.zshrc @@ -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() {