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

Re: Rewrite of zsh-newuser-install



On Tue, Feb 9, 2021 at 12:56 PM 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...?

I have used . (dot) as a prefix. I have also used and seen : (colon).
But if you really want to see someone go wild with prefixes, check out
the Zinit code: https://github.com/zdharma/zinit/blob/master/zinit.zsh

It uses : (colon), . (dot), @, + and - (dash). And since Zinit is
quite popular and thus influential, this has influenced other plugin
developers, too. Plus, Zinit's author actively advocates using a whole
bunch of different prefixes in this document, which I've seen
references to in several plugins:
https://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html#_the_proposed_function_name_prefixes

The list there includes . (dot), → (arrow right), +, / (slash) and @.
So, yeah, there's plenty of prefixes out there.

> On macOS, that's probably true. Like i said, i do hide them myself. I just
> don't know about other systems and use cases. Does anyone else have an
> opinion? If it seems risky elsewhere, but OK for macOS, we could gate it
> behind [[ $OSTYPE == darwin* ]], i guess.

How is it risky? If you need to find a username that starts with a
certain prefix, then you will still be able to find it by typing said
prefix. We have included the _ignored completer, after all.

> I just thought it'd be nice to have an easy way for people who are already
> invested in prompt themes to switch to whatever this cool new prompt is going
> to be (without having to hunt down the template file and copy/paste).

Ah, you mean, define the prompt in the system, rather than in this
.zshrc file? Yeah, that could make sense.

> 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.

Actually, I am currently working on a prompt system of my own (not
published anywhere yet). But instead of making this separate plugin, I
could of course consider contributing this back "upstream" in the form
of improvements to promptinit & co. Would that be something that you'd
be interested in? I can of course first publish the code, so you can
actually see what I'm talking about.




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