Giter VIP home page Giter VIP logo

Comments (6)

eric-hansen avatar eric-hansen commented on July 20, 2024

The issue here is when a package is lazy-loaded, vim.cmd [[packadd ...]] needs to be used prior to require(). So what I may need to do is add vim.cmd [[ <pkg> ]] to Vapour.utils.plugins.require_if_installed() or something, because otherwise it'll just keep causing issues.

from vapournvim.

hackorum avatar hackorum commented on July 20, 2024

I think e67d293 fixes this for now. Maybe we can add a lazy load parameter to require_if_installed and if it is true then do vim.cmd('packadd ' .. pkg) or something like that?

from vapournvim.

hackorum avatar hackorum commented on July 20, 2024

I have implemented the checking for lazy loading in the require_if_installed function and tested it with treesitter and the markdown-preview.nvim plugin and it seems to be working fine.

from vapournvim.

eric-hansen avatar eric-hansen commented on July 20, 2024

I've tweaked the require_if_installed function slightly since I started realizing not all repos are the module names, which is a little annoying. But I'll port your changes as well over.

I didn't say this yesterday as I was exhausted by the time, but I think just part of the issue is some need to not be lazy-loaded, while others do.

Locally how I have it now is which-key is not lazy loaded, but for example NvimTree is. In the plugins conf it's loaded on :NvimTreeToggle command, so when I do <leader>e then it gets loaded without issue.

This might be a good safe way to go about this. Because doing packadd imo defeats the purpose of lazy-loading. I just couldn't get it to work any other way prior, but I think the above is a sane approach.

Another reason why I think this issue is such a thing is because even though these various packages are lazy-loaded, they're still trying to be loaded outside of their trigger scope if you will (event/cmd), which is causing the issues. So I'll work with that, as we should just need to edit the plugins file to config = function () require'...' end, which I've done in some situations already.

from vapournvim.

hackorum avatar hackorum commented on July 20, 2024

Now I get "which-key" not existing every time I start neovim. I am not sure if it is good or bad. Does this mean that it is getting lazy loaded?

from vapournvim.

eric-hansen avatar eric-hansen commented on July 20, 2024

Now I get "which-key" not existing every time I start neovim. I am not sure if it is good or bad. Does this mean that it is getting lazy loaded?

Yeah. I got that fixed in my modularize-vapour branch, the main thing I'm running into right now is auto-complete not working for some reason. So been trying to figure that out.

from vapournvim.

Related Issues (20)

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.