Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
lib/vim-plugin: Add support for
luaConfig
#2624base: main
Are you sure you want to change the base?
lib/vim-plugin: Add support for
luaConfig
#2624Changes from all commits
1b9f331
3542fd5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial reaction: I'm not a fan of this.
I don't think it makes sense to assign lua code to an option named "globals*".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the intention is that this is lua code injected pre/post the lua impl for the
globals
option.But reading the option name I'd half-expect to be able to assign
globals
earlier or later than normal.This feels like working around a poor design rather than an objective improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if instead, each plugin should be responsible for using
vim.g[k] =
itself. Perhaps withinluaConfig.init
?Yes, this would mean vim-plugins aren't taking advantage of the
globals
option, and consiquently end-users won't see the configured globals when inspecting the option's value. But perhaps that is worth it in order to locate the globals in a more predictable location?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea: Perhaps the
luaConfig
submodule could also be used for non-plugin modules too? E.g. we could have aglobalsLuaConfig
option, and move the lua impl toglobalsLuaConfig.init
?(maybe rename
init
something likemain
,content
,text
, etc?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really a fan of any of the three solutions, tbh. So open to alternative proposals too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though about that, but I think setting the global options in nix is a bit better, as it allows to do more compile time stuff (though you could still do compile time stuff by accessing the plugin's settings)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be a use for it, for example to define helpers for keymaps, or options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still like the global option interface being used, too. I guess I am not too sure of when a vim plugin would use it, though. Almost feels like we would start blending the
mkNeovimPlugin
andmkVimPlugin
stuff together into one solution that has these arguments to declare what functionality and routing is done. Could just add an argument for whether its avim
orneovim
plugin so that we can properly group things and/or gate defaults.