英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论