goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.84k stars 109 forks source link

feat: send User AlphaClosed autocommand on close #102

Closed will closed 2 years ago

will commented 2 years ago

When Alpha starts it sends the User AlphaReady autocommand. As a mirror to that this patch adds a User AlphaClosed which runs when closing Alpha to give users a chance to do whatever custom cleanup they need.

goolord commented 2 years ago

you can already do autocmd BufUnload <buffer> to add custom cleanup, but mayb this is more intuitive

will commented 2 years ago

Oh, thanks! I didn't think of BufUnload. That does appear to work for my (not very serious at all) use case

https://user-images.githubusercontent.com/1973/164551845-c950d2fb-d114-4a47-a2be-01c4de80d2ab.mov

It is maybe easier to discover a new command since you see it in the source if you look, but I'm happy either way. Feel free to just close this if you want.

LandonSchropp commented 1 year ago

@goolord Thanks for adding this! Would it be possible to request adding it to the documentation? I didn't realize it was there until I read the code. 🙂

goolord commented 1 year ago

https://github.com/goolord/alpha-nvim/commit/4b0ba68022d8612b04b26844f1ce5e708c0d23b0 @LandonSchropp

LandonSchropp commented 1 year ago

@goolord Thank you! ❤️