5

Is it possible to customize zsh so that when I type, say, sudo ls and then hit Alt-h to see man page of the command ls. The default behavior of run-help is to show me the man page of the command sudo, instead of ls.

1 Answer 1

5

Yes, you can. Run the following lines or add them to your .zshrc.

autoload -U run-help autoload run-help-sudo 

from zsh wiki:

[run-help] can be further customized by defining helper functions of the form run-help-command.

There are other helper functions, as of version 5.0.8:

  • run-help-git
  • run-help-ip
  • run-help-openssl
  • run-help-p4
  • run-help-sudo
  • run-help-svk
  • run-help-svn

If you are running a Debian, you can find all helper functions function by:

dpkg -L zsh-common | grep run-help

Sign up to request clarification or add additional context in comments.

1 Comment

In case it might be helpful for someone, as of arch 5.9-5, it seems be required to unalias run-help first. I have no idea why, and it is not so in Ubuntu's 5.8.1. Anyway the comment in such run-help function files said that and worked for me.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.