Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Can you support Packer? #974

Open
tsoernes opened this issue Jul 15, 2022 · 6 comments
Open

Can you support Packer? #974

tsoernes opened this issue Jul 15, 2022 · 6 comments

Comments

@tsoernes
Copy link

I want to suggest a new step

Which tool is this about? Where is its repository?

neovim plugin manager
https://github.com/wbthomason/packer.nvim

Which operating systems are supported by this tool?

What should Topgrade do to figure out if the tool needs to be invoked?

Which exact commands should Topgrade run?

:PackerSync

I want to suggest some general feature

Topgrade should...

More information

@mrjones2014
Copy link

Which exact commands should Topgrade run?

More accurately, to update Packer plugins from the command line, you can do:

nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'

This will:

  • Open Neovim headless
  • Set up an autocmd to quit Neovim when Packer is done
  • Run :PackerSync in Neovim

@svenXY
Copy link
Contributor

svenXY commented Aug 17, 2022

did you see #756 ? packer.nvim is actually already supported, but does not correctly work. I'd love to see this working somehow, but given that due to the asynchronous way packer is run, the batch mode seems to have to be called differently, which is why the generic solution with upgrade.vim for all (n)vim package managers will likely not work

@mrjones2014
Copy link

mrjones2014 commented Aug 17, 2022

due to the asynchronous way packer is run

Yeah, the command I posted above solves this -- it opens Neovim headless, sets up an autocmd, then runs packer, so it waits for packer to finish before exiting neovim.

nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'

@mrjones2014
Copy link

Oh it looks like this is pretty much what that PR is doing. I wonder why it was closed.

@svenXY
Copy link
Contributor

svenXY commented Aug 17, 2022

because it does not work the way update.vim is constructed - nvim is always executed with the same parameters and update.vim as the file to be executed and that seems to interfere with the asynchronicity.

@wbthomason
Copy link
Contributor

The PR also died because I didn't have time to keep debugging it at the time. It was unclear if the change I proposed to the arguments topgrade passes to Neovim actually solved the issue or merely revealed another. If you'd like to pick the PR up where I left it, it's still the basic approach I would take.

A reasonable alternative may be to define a custom command for topgrade with the command @mrjones2014 suggests above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants