wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.85k stars 265 forks source link

API: re-add `packer.sync()` #1161

Open clason opened 1 year ago

clason commented 1 year ago

In v1, packer.sync() was my go-to function for installing and updating plugins. It would be nice if it could be re-exposed in v2, same as :PackerSync (which is available but feels wrong to bind to a mapping if I can directly bind the Lua function instead).

lewis6991 commented 1 year ago

There is obviously plans to add a Lua API. However, for this specific case I would suggest sticking with the ex command since that will lazy load packer.actions which pulls in quite a lot. That is unless you are manually wrapping the function.

IMO mapping onto a Lua function only has benefit when passing a complicated set of arguments.

clason commented 1 year ago

I was only mentioning this since the README already lists packer.clean() etc., so it looked like an oversight (or something trivial to add if there was demand, which there is :))

But if there's a reason not to do it, that's fine too -- feel free to close this then.

lewis6991 commented 1 year ago

The request is totally valid and planned. I was just making a light suggestion.

I'm just cleaning the README up a bit now.