Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single line load() for adding packages #101

Merged
merged 2 commits into from
May 28, 2022

Conversation

samerickson
Copy link
Contributor

About

Adds the ability to add packages one at a time, as requested in #88.

Honestly, I think it is better to load all plugins in a plugins.lua file, then create a <plugin>.lua file for the configuration of that plugin, but you could use this fork if need be.

Configuration

local paq = require("paq")
paq.load("<package>")

Example usage

Say you wanted to load tpope/vim-surround, then you could do the following:

require("paq").load("tpope/vim-surround")

-- or
local paq = require("paq")
paq.load("tpope/vim-surround")

@megalithic
Copy link

megalithic commented Apr 14, 2022

Great job!

This could be handy for conditional loading of things; an example is kitty-related plugins vs. tmux-related plugins. you can load them only when vim.env.TMUX is true, for instance; similar to packer.nvim's cond attr.

@savq any thoughts on this?

@savq
Copy link
Owner

savq commented May 1, 2022

Hi @samerickson,

Sorry for taking so long to review.

I'm not against having this functionality. In fact, it's already available under the paq function. That was the original name,
but it's probably confusing since the module is named 'paq'. My reasoning for not making the single-table-call the default is already partly explained in 88.

The thing I am opposed to is calling the function load because Paq isn't doing the loading. Paq puts the plugin in the right place, but neovim loads it. So I think making register a public function might be more explicit.

@samerickson
Copy link
Contributor Author

@savq Thanks for the feedback. I have changed the name of the function to register!

@savq savq merged commit 2db3fbe into savq:master May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants