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

Re: Rewrite of zsh-newuser-install



On Tue, Feb 9, 2021 at 11:56 AM dana <dana@xxxxxxx> wrote:
>
> What other characters besides _ do you know of that are used as prefixes? If
> that's the only one, we could at least err on the side of limiting it to
> that...?

In my code I nowadays start internal functions with '-':

  function -z4h-foo-bar() { ... }

Here z4h is a project-specific prefix.

I use '-' because it's consistent with my word delimiter of choice for
function names, and because it's not '_' (I use the latter only for
completion functions).

I think ignoring functions, parameters and users that start with
[:punkt:] is fine. It's not uncommon for completions to draw an
arbitrary line between showing not enough and showing too much.

> At first glance the sorting logic does seem a bit elaborate like i said, but
> idk. If you do want to define any functions for the config, i would just make
> sure to give them names that aren't likely to conflict with anything else.
> _lowercase seems really generic. You could at least make it, like...
> _zshrc_lowercase, or something.

It would be great if the config didn't define any functions. Custom
sorting is something I would give up without second thoughts if it
means the config gets shorter and simpler.

There is a threshold of config length and complexity after which users
will treat it as a magic back box. It's different for different users
but for the vast majority of users it's very low. Every extra line,
and especially every new concept or abstraction, will cause some users
to lose control over their shell configuration. Users who can tolerate
more complexity can easily increase it. Users who cannot comprehend
the config won't be able to simplify it.

> I assume Roman's concern is that prompt themes are too 'magic' for a default
> config that's partially meant to show new users how to customise the shell to
> their liking, which is fair.

Correct, that's what I meant.

Once again, users who prefer to use advanced features will be able to
do that. Many will want to use third party plugins and themes, and
that's fine. Our job here is to provide foundation. It won't
necessarily be the best but it should be very simple and amenable to
customization.

Roman.




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