Git Product home page Git Product logo

Comments (6)

Soares avatar Soares commented on August 21, 2024

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.

chiphogg avatar chiphogg commented on August 21, 2024

Ah; I think I understand better now. I also read up on the maktaba docs.

It looks like the order of operations is:

  1. Add a plugin to the rtp
  2. "Install" the plugin
  3. Configure the plugin (using Glaive, or cumbersome direct maktaba function calls, or some other means)
  4. 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.

dbarnett avatar dbarnett commented on August 21, 2024

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.

chiphogg avatar chiphogg commented on August 21, 2024

"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.

dbarnett avatar dbarnett commented on August 21, 2024

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.

Soares avatar Soares commented on August 21, 2024

Merged.

from vim-glaive.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.