Re:Zsh Tricks to Blow Your Mind
by petepete on Thursday February 18, 2021 @02:39AM
(#26177072)
I'm happy in zsh or bash but the one thing I love in zsh is that completion options for program arguments. Having a list with a snippet of documentation to tab through is a huge benefit.
[ Parent
| on HN ]
Bash supports completions as well.
IIRC, bash doesn't support extended completion editor features of ZSH, which GP alluded to - like generating a table of options with help strings that can be selected by arrow keys and the like.
A (slightly contrived) example:
> rsync --e«TAB»
Completing file
some-file-with-extra-hyphens
Completing host
a-n-example.local
Completing option
--cvs-exclude -- auto-ignore files the same way CVS does
--delete-excluded -- also delete excluded files on the receiving side
--exclude -- exclude files matching pattern
--exclude-from -- read exclude patterns from specified file
--executability -- preserve executability
--ignore-existing -- ignore files that already exist on receiving side
--ignore-non-existing --existing -- ignore files that do not exist on receiving side
There are various ways to present the completion; I have the simple "keep typing letters" way, but Zsh can also present a table with an entry to highlight.