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

Feat: add PackerSnapshotDone autocmd

Open younger-1 opened this issue 3 years ago • 1 comments

Description

Add a new PackerSnapshotDone autocmd which will be fired after PackerSnapshot command. Why? As https://github.com/wbthomason/packer.nvim/pull/370#issuecomment-1051643004 said, the snapshot file generated is not ordered or stable and is not ideal for checking into source control and easily seeing what changed. Before packer could expand and sort the generated snapshot file, this is needed for more smooth experience of packer's snapshoot feature.

usage example:

autocmd User PackerSnapshotDone lua require('utils').sort_snapshot_file()

Test

I have test the commits of the pull request in Archlinux-WSL and Windows 10 and in both environments the autocmd works well.

see usecase here https://github.com/younger-1/nvim/blob/d0ce631b41644e841a25bc7eac0b053a288ce0fe/lua/young/plugin-loader.lua#L131-L132

younger-1 avatar May 01 '22 06:05 younger-1

@wbthomason Do you have any feedback for this feat? Thanks!

younger-1 avatar Jun 09 '22 11:06 younger-1