Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Rewrite of zsh-newuser-install



>>>>> On February 9, 2021 Marlon Richert <marlon.richert@xxxxxxxxx> wrote:

>> > zstyle ':completion:*:(functions|parameters|users)' ignored-patterns '[[:punct:]]*[[:alnum:]]*'
>> 
>> Not sure about this. I like hiding completion functions (which i did in mine),
>> because their naming format is pseudo-reserved for zsh by convention, and i've
>> seen many people confused by their appearance in completion possibilities. But
>> anything beyond that seems heavy-handed for a default.

> There are various Zsh plugins and plugin managers that mark private
> functions and parameters with various punctuation prefixes. It's
> annoying to get these randomly inserted into completions and makes the
> completion system that much harder to use. Since there is no
> consistency between plugins & plugin managers what prefix to use for
> private functions and all punctuation symbols appear to be fair game,
> I prefer to use a blanket ignore pattern like this. I haven't yet
> found a case where it would hide something that I would actually want
> to see. Additionally, as someone else pointed out, macOS has a ton of
> system users with names that start with underscores. You generally
> don't want to see those either.

FWIW you can also use the prefix-needed zstyle for this purpose,
for commands, functions, and parameter names:

from Etc/ChangeLog-4.3:
|2011-03-08  Barton E. Schaefer  <schaefer@xxxxxxx>
|
|        * Greg Klanderman: 28846: Completion/Zsh/Type/_functions,
|        Completion/Zsh/Type/_command_names,
|        Completion/Zsh/Type/_parameters, Doc/Zsh/compsys.yo: adapt
|        prefix-needed zstyle to handle the completion function naming
|        convention of a leading underscore.

Maybe the set of hard-coded prefixes should be expanded from [^_.]
though; I do not use and plugins so it has not been a problem for me.

Greg




Messages sorted by: Reverse Date, Date, Thread, Author