augroup can help grouping related autocmd together. It's cleaner, better for management and organization. It's another style of autocmd declaration. It works closely with autocmd! which will if used inside augroup will help removing any autocmds ever declared previously inside augroup. So user can source ~/.vimrc or custom file multiple times without breaking anything.
In this video, I will go through bunch of examples to build understanding toward augroup. But the video starts clearly with simple augroup usage to get a feel of what it can do for us.
My apology that I keep saying autocmd-exclamation-mark (in which it is autocmd!), but you can say autocmd-removal
Although there are more examples for autocmd! in this video, but augroup takes part of it as closely related feature.
** Chapters **
0:00 Introduction
1:33 Get a feel of augroup
4:38 Effect of sourcing .vimrc file multiple times
5:20 autocmd! in action
7:01 autocmd! 2nd example
11:26 autocmd! 3rd example
12:43 autocmd! 4th example
13:27 autocmd! 5th example
14:08 Summary
#vim #techniques #augroup #autocmd
** Follows Wasin on socials **
Website: https://wasin.io
Twitter: @haxpor
Github: https://github.com/haxpor