agkozak / agkozak-zsh-prompt

A fast, asynchronous Zsh prompt with color ASCII indicators of Git, exit, SSH, virtual environment, and vi mode status. Framework-agnostic and customizable.
MIT License
292 stars 26 forks source link

FR: zsh `promptinit` API support #33

Closed eddyg closed 3 years ago

eddyg commented 3 years ago

Thanks for the flexible, lightweight, easy-to-understand prompt!

Any plans to implement support for Zsh's promptinit API?

(For ref, this was brought up in this zsh-snap issue.)

agkozak commented 3 years ago

Thanks for the compliment!

I'll look into it.

agkozak commented 3 years ago

OK, I've got the develop branch working with promptinit (with this commit); I'll merge it to master when I've cleaned up and tested a few things.

I've done the following so far:

I'll try to provide a prompt preview function when I have more time.

Thanks, @eddyg and @marlonrichert, for helping to make the prompt better.

* @marlonrichert, don't you have a proposed patch for the current promptinit API documentation? What we have now doesn't sufficiently explain the naming conventions necessary to make any of this work.

marlonrichert commented 3 years ago

@agkozak Yes, I’m working on a promptinit patch, but it updates only a tiny part of the documentation. What questions do you need answered?

agkozak commented 3 years ago

The sentence

The precmd and preexec hooks are automatically adjusted if the prompt theme changes or is disabled.

should really be something more like

If your precmd and preexec hooks are named prompt_name_precmd and prompt_name_preexec (where name is the name of your theme), they will be automatically adjusted if the theme changes or is disabled.

marlonrichert commented 3 years ago

Yes, that part of the documentation will be improved with my patch.

agkozak commented 3 years ago

@eddyg @marlonrichert Release v3.10.0 now has full promptinit compatibility. Thanks for your suggestions.