Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change custom plugins examples and guidelines #197

Closed
desyncr opened this issue Jan 9, 2018 · 5 comments · Fixed by #206
Closed

Change custom plugins examples and guidelines #197

desyncr opened this issue Jan 9, 2018 · 5 comments · Fixed by #206

Comments

@desyncr
Copy link
Member

desyncr commented Jan 9, 2018

Current documentation suggests for plugins to self register. Back then it was a good idea as it loaded plugins configuration-free.

Current implementation (right and left prompt pluggable) enables further customization and it makes sense to be able to tell the plugins to either load at the right or left prompt:

GEOMETRY_PROMPT_PLUGINS_SECONDARY=(custom_plugin ...)
# Or
GEOMETRY_PROMPT_PLUGINS_PRIMARY=(custom_plugin ...)

This conflicts with the current plugin loading approach as by default self-registration uses the SECONDARY prompt as target.

We do support both registration methods but should update the documentation to use the configuration approach rather than self-registration.

An example configuration would be such as:

# Add the plugin to a prompt, in this example "secondary"
GEOMETRY_PROMPT_PLUGINS_SECONDARY=(custom_plugin ...)

# Source the plugin script BEFORE geometry
source custom_plugin.zsh

# Finally source geometry theme
source geometry.zsh
@desyncr
Copy link
Member Author

desyncr commented Jan 9, 2018

Actually there's a little fix needed for custom-plugins to be able to be configured by context.

@frm
Copy link
Member

frm commented Feb 28, 2018

@desyncr can we label this as a nice first PR for people?

@jedahan
Copy link
Member

jedahan commented Mar 17, 2018

Is there any case that someone would want to source a geometry plugin and it not be present in secondary prompt?

I would rather have us auto-put in secondary prompt, UNLESS it is defined to be in primary prompt by user.

So default configureless, but if you configure it overrides.

@frm
Copy link
Member

frm commented Mar 17, 2018

Is there a way for this to happen though? You have to explicitly set it to the secondary or primary variable, right?

@jedahan
Copy link
Member

jedahan commented Mar 17, 2018

we check in register function if plugin is currently in PRIMARY. if it is, we do nothing. if its not, we register to SECONDARY

i havent looked at the code in a while though, so i might be missing something obvious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants