How to I make a custom tag-order? #155
-
I'm trying to make use of my own zstyle ':completion:*' tag-order '! ancestor-directory recent-directories recent-files' 'flags arguments local-directories files builtins history-words' With that setting, zstyle -e ':completion:*:complete:*' tag-order $'\n if [[ CURRENT -ne 1 && $compstate[context] == (command|condition) &&\n $PREFIX$SUFFIX == [-+]* ]]; then\n reply=( "(|*-)argument-* (|*-)option[-+]* values" options - )\n else\n reply=( "! options *files *directories" "*files *directories" - )\n fi\n '
zstyle ':completion:*:expand:*' tag-order '! all-expansions original' -
zstyle ':completion:*:(approximate|correct):*' tag-order '! original' -
zstyle ':completion:*' tag-order '! ancestor-directory recent-directories recent-files' 'flags arguments local-directories files builtins history-words' With my setting, I want to make suggestions appear in the order There's no clear documentation on this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
First of all, despite what its name might suggest, If you want to change the order in which completions are presented, then Additionally, for your setting to override the one defined by Finally, What you want is something like this: zstyle ':completion:*:complete:*:' tag-order '! ancestor-directories recent-directories recent-files' -
zstyle ':completion:*:complete:*:' group-order \
options arguments values local-directories files builtins history-words Note the Note also the extra I will see if I can improve the Readme on this. |
Beta Was this translation helpful? Give feedback.
First of all, despite what its name might suggest,
tag-order
doesn't govern the order in which completions are shown. Instead, it governs the order in which completions are tried within a single completion function. Additionally, it can be used to disable certain completions, by removing them fromtag-order
.If you want to change the order in which completions are presented, then
group-order
is setting you'll need to use. Unliketag-order
, though, it supports neither!
nor patterns, and it expects each group to be added as a separate value.Additionally, for your setting to override the one defined by
zsh-autocomplete
, it needs to have more weight. This works similarly to CSS: The more el…