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.72k stars 262 forks source link

Check if declared plugins are installed on disk (optionally if installed plugins need syncing) #1094

Open haras-unicorn opened 1 year ago

haras-unicorn commented 1 year ago

Describe the feature

I know there is a packer_plugins table, but it would be cool if there was a packer.is_synced() function that checks whether all declared plugins using pakcer.use (including rocks using packer.use_rocks) are installed on disk. It would be nice if this function returned a table of all the plugins that are not synced. This way it would be possible to add a new plugin while inside Neovim and have a autocmd that reloads your config and conditionally syncs plugins that are not installed on disk.

It doesn't need to check whether already installed plugins need syncing (like if the remote git branch is not in sync with the branch on disk) but it would be cool if it did that as well. ~If it did that, it would be possible faster to run packer.sync asynchronously on every startup for plugins that need syncing and notify the user if there are some breaking changes.~ Nevermind, this is something that packer.sync already does.