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

[Feature]: Add possibility to override plugin loading event #2300

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

epontan
Copy link

@epontan epontan commented Feb 20, 2022

Description

It can be useful be able to override which event a core plugin should be loaded from the user configuration.

Add an event attribute to the default configuration of all core plugins that have an event configured and refer to that from the plugins module.

This implements the approach suggested in #1692.

How Has This Been Tested?

My use case was to make gitsigns.nvim load on startup when not starting vim with a file as argument (not only when BufRead event is triggered).
I use the gitsigns plugin to review all the changes of last commit by changing its base (e.g. HEAD~1).

In my config.lua I override the default configuration like this:

lvim.builtin.gitsigns.event = "VimEnter"

This makes the plugin available at start without having to open a file first.

It can be useful be able to override which event a core plugin should be
loaded from the user configuration.

Add an `event` attribute to the default configuration of all core
plugins that have an event configured and refer to that from the plugins
module.
@kylo252
Copy link
Collaborator

kylo252 commented Feb 23, 2022

I've been thinking about this for a while for the commit part which has now become relevant, so we still need to handle the rest of the supported attributes. I'm not sure what is a clean way to do this, so maybe we should instead resurrect #1692, or something similar?

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

Successfully merging this pull request may close these issues.

None yet

2 participants