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
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-gitrun-help-iprun-help-opensslrun-help-p4run-help-sudorun-help-svkrun-help-svn
If you are running a Debian, you can find all helper functions function by:
dpkg -L zsh-common | grep run-help
1 Comment
InQβ
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.