Zsh:`man` 命令的参数自动完成

huangapple go评论72阅读模式
英文:

Zsh: argument autocompletion for `man` command

问题

有没有一种原生方法可以自动完成man命令的参数?

例如:man loc<Tab>可以循环浏览可用选项("local","locale","localedef"等...)

直到不能做到这一点之前,这并不让人讨厌 :p

英文:

Is there a native way to autocomplete the argument for the man command?

E.g.: man loc<Tab> to cycle through the options avaiable ("local", "locale", "localedef", etc...)

Not being able to do it wasn't annoying until it was :p

答案1

得分: 0

compinit 设置(如 @Gairfowl 提到的 autoload -Uz compinit)会显示来自 $FPATH(其中包含函数定义)的补全函数。在 man 的情况下,它会从 $FPATH 中的 _man 文件获取。在我的情况下,我在 macOS 中,它位于 /usr/share/zsh/5.8.1/functions

英文:

the compinit setting (as in autoload -Uz compinit mentioned by @Gairfowl) will show the completion functions from the $FPATH (where the functions definitions are). In the case of man it will get it from the _man file in the $FPATH. In my case I'm in macOS and it's located in /usr/share/zsh/5.8.1/functions

huangapple
  • 本文由 发表于 2023年2月24日 00:34:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75547700.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定