packer.nvim icon indicating copy to clipboard operation
packer.nvim copied to clipboard

README: make bootstrapping smoother

Open acid-bong opened this issue 2 years ago • 0 comments

Actions in the execution order:

  1. if it's a bootstrap, the config stops executing after the plugins are used (taking packer.sync() out of packer.startup() ensures that they run in series): if there are plugin-specific options down the file, no user wants seeing errors for currently non-existent commands
  2. the bootstrap-only autocmd re-sources init.lua after PackerSync completes

The long windo command is more of an eyecandy: since on bootstrap the window with the file is completely undecorated (no line numbers and stuff), init.lua is sourced on all windows but the one created by PackerSync (I don't like how it looks with line numbers and a signcolumn on). Then the cursor is returned to that window by its ID.

Restriction: this snippet only works when in init.lua and not in a module (from where it's unable to stop parsing init.lua)

acid-bong avatar Jul 03 '23 08:07 acid-bong