diff --git a/terminal/.config/zsh/zshrc b/terminal/.config/zsh/zshrc index cd73e71..9c4e4d2 100644 --- a/terminal/.config/zsh/zshrc +++ b/terminal/.config/zsh/zshrc @@ -94,8 +94,11 @@ zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath' # show systemd unit status zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status $word' # env var contents -zstyle ':fzf-tab:complete:(-command-|-parameter-|-brace-parameter-|export|unset|expand):*' \ +zstyle ':fzf-tab:complete:(-parameter-|-brace-parameter-|export|unset|expand):*' \ fzf-preview 'echo ${(P)word}' +# give MAN pages for cmds or show their expanded path +zstyle ':fzf-tab:complete:-command-:*' fzf-preview \ + '(out=$(tldr --color always "$word") 2>/dev/null && echo $out) || (out=$(MANWIDTH=$FZF_PREVIEW_COLUMNS man "$word") 2>/dev/null && echo $out) || (out=$(which "$word") && echo $out) || echo "${(P)word}"' # show hostname if we are in a distrobox environment if [ -n "$DISTROBOX_ENTER_PATH" ] && [ -f /run/.containerenv ]; then