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.
Asked
Active
Viewed 550 times
4
Vika Marquez
- 353
- 1
- 3
- 12
Yasushi Shoji
- 4,028
- 1
- 26
- 47
1 Answers
4
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
Yasushi Shoji
- 4,028
- 1
- 26
- 47