zsh-users
 help / color / mirror / code / Atom feed
* completion, sorting of options
@ 2023-11-04 15:42 Thomas Lauer
  2023-11-04 15:49 ` Mikael Magnusson
  2023-11-08 13:24 ` Thomas Lauer
  0 siblings, 2 replies; 15+ messages in thread
From: Thomas Lauer @ 2023-11-04 15:42 UTC (permalink / raw)
  To: Zsh Users

So I'm writing my first completion file (gory thing, just the right
thing for a rainy Sat afternoon). The completion file itself is more or
less working, but I've run into trouble with the options display after
"-<TAB>".

Basically what I want to achieve is that the options are listed in
precisely the order given in the completion file (there are many options
and some are much more probable to be used than others, so I want these
at the top (I know that further typing will limit the shown completions
but not all people using this will be up to that... a simple up/down
might work better for some)).

So I created a zstyle like this:

zstyle ':completion:*:*:mycmd:*:*' sort false

And this *does* change the order but not as expected. Rather, the
completion now first displays all single-letter options (-X), followed
by the -X=value options. Those two sublists are indeed shown in the same
order as in the completion file but in the completion the -X options
*follow* the -X=value options. So there's still something going on...
but I can't see what. (I've also tried "sort nosort"... no change).

Probably the zstyle still needs some more massaging but I haven't a clue
where to look... but one of the z-gurus might know?!

Thanks for helping out  T


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-11-10 17:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-04 15:42 completion, sorting of options Thomas Lauer
2023-11-04 15:49 ` Mikael Magnusson
2023-11-05 15:02   ` Thomas Lauer
2023-11-05 15:58     ` Bart Schaefer
2023-11-05 16:58       ` Thomas Lauer
2023-11-08 13:24 ` Thomas Lauer
2023-11-08 20:09   ` Bart Schaefer
2023-11-08 20:44     ` Ray Andrews
2023-11-08 21:34       ` Bart Schaefer
2023-11-08 22:41         ` Ray Andrews
2023-11-09 13:32     ` Thomas Lauer
2023-11-09 18:07       ` Bart Schaefer
2023-11-10 14:04         ` Thomas Lauer
2023-11-10 15:09           ` Ray Andrews
2023-11-10 17:15           ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).