Giter Site home page Giter Site logo

Comments (1)

savq avatar savq commented on July 17, 2024 2

@savq thank you so much for this plugin.

I'm glad you find it useful!

i noticed you don't ever actually source/require/load your packages.lua in your dotfiles…

You're right, I don't source Paq on startup; like you said, I only do it when updating stuff. Using my dotfiles calling :lua require 'packages' is enough to update everything.

I use it that way because Paq technically only creates the list of packages once, so if I remove something, Paq won't know unless I reload it (or restart nvim). Updates don't have that problem.

How do we know a plugin that is installed with paq is sourced/loaded to then set their config via lua too?

That's a pretty good question because… it depends. The vim component of a plugin works as usual (plugin, autoload, etc), and these plugins usually set global variables to avoid reloading, you can use those to know if the plugin is loaded. The Lua part of a plugin is never sourced automatically, so an all-Lua plugin is only loaded if you call require.

Lua has a special table package.loaded that lists all modules (and submodules) that have been defined, so to be sure foo was sourced you'd have to do:

if not package.loaded['foo'] then
    require('foo')
end

My dotfiles actually leverage that table, because that's how Plenary "reloads" packages, by nulling the entry in the package.loaded.

This question also made me realise there was a small mistake in my dotfiles. I was calling require 'paq-nvim' before calling reload_module. So that's also fixed now, thanks 👍

from paq-nvim.

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.