-
Notifications
You must be signed in to change notification settings - Fork 15
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
Glaive appears not to work in .vimrc #4
Comments
The plugin is installed but not loaded. Vim loads plugins after vimrc time, before startup is completed. Commands become available after the plugin is loaded, which is why Glaive is working after startup completes. In order to load Glaive during the vimrc (and thus make the commands available in the vimrc) you must either source the bootstrap file or call the glaive#Install() function. |
Ah; I think I understand better now. I also read up on the maktaba docs. It looks like the order of operations is:
I previously thought step 1 and 2 were the same. It stlil seems like they should be the same. That's how it is internally at Google, and it's much more convenient. Is it fair to say that as things stand now, Glaive is somewhat difficult to use? In that the user needs to call Is it also fair to say that this problem won't be fixed until we have a maktaba-native plugin manager? (Unless of course other plugin managers start supporting maktaba natively, and I see no reason to think they will.) A maktaba-native plugin manager could roll up all 3 of the first steps into 1. An explicit example illustrates what a big difference a maktaba-native plugin manager could make. Configuration could be as easy as Install 'chiphogg/vim-vtd' contexts=`['-home']` Whereas currently, this looks like Bundle 'google/maktaba'
Bundle 'google/glaive'
call glaive#Install()
Bundle 'chiphogg/vim-vtd'
call vtd#Install()
Glaive vim_vtd contexts=`['-home']` |
Nate's pull req #1 will make this slightly better by letting Glaive auto-install the plugin via maktaba if it's on runtimepath but maktaba doesn't know about it yet. That should obviate the need for the per-plugin calls like Of course, maktaba is designed to be a plugin manager library and not a plugin manager per se, so a maktaba-native plugin manager will definitely make things nicer and we're not heavily optimizing the convenience of the you-are-the-plugin-manager case. |
"Slightly" better? Are you kidding -- that's a huge improvement! That takes it from N extraneous lines down to 1 (the It's funny -- when that pull request first came out, I didn't understand the distinction between rtp-adding, installing, and loading. By the time I encountered the problem myself, I'd completely forgotten about it. Nate -- any reason this pull request hasn't been merged yet? It got the LGTM 18 days ago. And, it fixes some real usability problems with Glaive. |
Well, I said "slightly" because in your example it only saves one line, so Bundle 'google/maktaba'
Bundle 'google/glaive'
call glaive#Install()
Bundle 'chiphogg/vim-vtd'
call vtd#Install()
Glaive vim_vtd contexts=`['-home']` becomes Bundle 'google/maktaba'
Bundle 'google/glaive'
call glaive#Install()
Bundle 'chiphogg/vim-vtd'
Glaive vim_vtd contexts=`['-home']` Having a plugin manager that speaks maktaba will allow us to coalesce this down a lot more.
I suspect he just forgot it's there because it's easier to forget pending changes in github. I'll ping him on Monday if he doesn't notice it, but he probably will after all this related discussion. |
Merged. |
I'm rewriting my plugin to use maktaba, and I want to use Glaive to configure it.
The relevant (I think) parts of my
.vimrc
:This fails like so:
Yet, when I run
:Glaive vim-vtd plugin[mappings]
by hand inside vim, it works just fine. I even verified that it changes the value of theplugin
flag from an empty dict tomappings: 1
.Is Glaive not ready by
.vimrc
-time?More broadly: how would one enable mappings in a maktaba plugin without Glaive?
The text was updated successfully, but these errors were encountered: