Replies: 1 comment
-
Hah! I just realized we have |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Traditional Vim plugins often check for some global variable like
g:my_plugin#no_mappings = 1
, and if it's not set, they apply a bunch of key mappings.Lua plugins are heading in a different direction, by exposing a
setup()
function that gives the user precise control over when the plugin takes effect, at the cost of having to explicitly writerequire('my-plugin').setup()
somewhere. This style of plugin works very well with Packer'suse({config = ...})
option, which frees the user from having to explicitly check if the plugin is loaded.The traditional Vim style of plugin needs configuration before the plugin is loaded. The expectation is that the user configures these settings in
.vimrc
/init.vim
, which is loaded beforeplugin/*.vim
in the startup sequence.For a user who wants to reorganize their config to take advantage of the
use({config = ...})
option, the need to put these settings ininit.vim
is a frustrating impediment.Does anyone have a good solution for this situation? Do you just deal with it and put these settings somewhere in
init.vim
?Maybe it would be possible for Packer to expose a function that gathers up
use({pre_config = ...})
functions and lets you run them all in one place ininit.vim
, e.g. with something likerequire('packer').pre_config()
. That way at least the main configuration file can be tidy, even if something still has to be manually invoked.Beta Was this translation helpful? Give feedback.
All reactions