Giter Site home page Giter Site logo

Comments (5)

saccarosium avatar saccarosium commented on August 17, 2024 1

The problem here is not that paq downloads packages asynchronously but rather that vim packages doesn't cope well with loading at runtime things from the start directory. Even if you force it with rtp. So for this reason the most manageble solution is to use the opt directory by default and then load the packages in bulk.

from paq-nvim.

saccarosium avatar saccarosium commented on August 17, 2024

Can you provide the error that it gives you and the config where you call paq?

from paq-nvim.

231tr0n avatar 231tr0n commented on August 17, 2024

image
When ever I add a new plugin, in my case it is a colorscheme called cyberdream.nvim and reopen neovim this error popups up and once i press enter, then the plugin is installed. But the require function is called before the plugin is installed sync paq.install() method runs asynchronously I guess.
Also below is my config
https://github.com/231tr0n/config/blob/main/nvim/init.lua

from paq-nvim.

saccarosium avatar saccarosium commented on August 17, 2024

Currently the best way to get this behavior in paq is using the setup option opt to set the default install directory to the opt directory (see :h packages) and then load the plugins using packadd.

I took the liberty to refactor your bootstrap_paq function, which is now the only function you need (you can remove clone_paq and paq_path)

local function bootstrap_paq(packages)
	local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim"
	if not vim.uv.fs_stat(path) then
        local url = "https://github.com/savq/paq-nvim.git"
		vim.fn.system({ "git", "clone", "--depth=1", url, path })
        vim.cmd.packadd("paq-nvim")
		vim.notify("Installing plugins")
	end
	local paq = require("paq"):setup({ opt = true })(packages)
    local to_install = paq.query("to_install")
    if not vim.tbl_isempty(to_install) then
        paq.install()
    end
    for _, p in pairs(packages) do
        if type(p) == "table" then
            p = p[1]
        end
        p = {vim.fs.basename(p)}
        vim.cmd.packadd({ args = p, bang = true })
    end
end

This should solve the problem.

from paq-nvim.

231tr0n avatar 231tr0n commented on August 17, 2024

Yup! thank you for helping me out

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.