nvim-neorocks / rocks-lazy.nvim

:sloth: A lazy-loading module for rocks.nvim
GNU General Public License v3.0
20 stars 0 forks source link

feature: more lazy loading options #3

Open TarunDaCoder opened 1 week ago

TarunDaCoder commented 1 week ago

Is it possible to add more options to lazy load plugins such as:-

mrcjkb commented 4 days ago

Hey :wave:

lz.n (the library that rocks-lazy.nvim uses) supports registering custom handlers that you can use to add additional lazy-loading capabilities.

Regarding your specific requests:

If the file opened is in a git repository for plugins like gitsigns.nvim

That's an interesting idea, but I'll have to think about it. PRs to lz.n are more than welcome :smile:

A rocks alternative to VeryLazy from lazy.nvim

This already exists. In rocks-lazy.nvim and lz.n it's called DeferredUIEnter.

After another specific plugin has been lazy-loaded [...]

That could be done in theory. The problem is: If users have to think about when plugins that depend on each other are loaded, that defeats the purpose of automatic dependency management. We want to keep rocks-lazy.nvim as simple as possible, and support the most common use cases without putting any additional maintenance burden on users.

and also other plugins like the addons for cmp etc.

lazy-loading nvim-cmp and its extensions is quite a headache. Most nvim-cmp sources use after/plugin to register themselves; a bad practise that doesn't work with Neovim's built-in packadd (which doesn't source after/plugin scripts).

for plugins like the rocks- modules, they can be loaded after rocks.nvim is loaded

No plugins are loaded before rocks.nvim is loaded.

TarunDaCoder commented 4 days ago

PRs to lz.n are more than welcome 😄

Haha I'm not rlly very good at such kind of things, I mainly just give the ideas.

This already exists. In rocks-lazy.nvim and lz.n it's called DeferredUIEnter.

Great! Thanks a lot for the info

We want to keep rocks-lazy.nvim as simple as possible, and support the most common use cases without putting any additional maintenance burden on users.

Right, I get it :D

lazy-loading nvim-cmp and its extensions is quite a headache

Yeah, I have had multiple issues with lazy-loading cmp

No plugins are loaded before rocks.nvim is loaded.

Oh, yeah 😅

TarunDaCoder commented 3 days ago

@mrcjkb

This already exists. In rocks-lazy.nvim and lz.n it's called DeferredUIEnter.

I'm running into an issue with this, whenever I load a plugin with event = 'DeferredUIEnter I get an error that the plugin is not found. Any way to fix this?

mrcjkb commented 3 days ago

Could you please provide a minimal example to reproduce it with in a separate issue?

TarunDaCoder commented 3 days ago

Could you please provide a minimal example to reproduce it with in a separate issue?

Sure