4

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.

Vika Marquez
  • 353
  • 1
  • 3
  • 12
Yasushi Shoji
  • 4,028
  • 1
  • 26
  • 47

1 Answers1

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-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

Yasushi Shoji
  • 4,028
  • 1
  • 26
  • 47