Comments (6)
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.
from vim-glaive.
Ah; I think I understand better now. I also read up on the maktaba docs.
It looks like the order of operations is:
- Add a plugin to the
rtp
- "Install" the plugin
- Configure the plugin (using Glaive, or cumbersome direct maktaba function calls, or some other means)
- Load the plugin
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 glaive#Install()
manually, and also needs to call myplugin#Install()
(or worse, maktaba#plugin#Install('/full/path/to/myplugin')
) for each plugin?
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']`
from vim-glaive.
Is it fair to say that as things stand now, Glaive is somewhat difficult to use? In that the user needs to callβ¦
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 vtd#Install()
above for plugins that don't otherwise need explicit installation (e.g., to trigger instant/ files).
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.
from vim-glaive.
"Slightly" better? Are you kidding -- that's a huge improvement! That takes it from N extraneous lines down to 1 (the glaive#Install()
). It makes Glaive usable.
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.
from vim-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.
Nate -- any reason this pull request hasn't been merged yet?
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.
from vim-glaive.
Merged.
from vim-glaive.
Related Issues (9)
- Could Glaive syntax be changed to match vim's :set? HOT 6
- Glaive feature to trigger plugin activation HOT 3
- Tab completion should only list plugins with flags
- Update guidelines to mention vroom
- :Glaive doesn't detect newly-added runtimepath entries HOT 1
- Document tab completion in help file
- Add custom completion for :Glaive HOT 3
- Mechanism to query current config
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-glaive.