I have many autocommands in my vimrc. Some of them do have the augroup wrapping to make them not duplicate when re-sourcing the vimrc, but many do not.
Rather than try to wrap all of them at this point, I figured that for my vimrc sourcing bind
nnoremap <Leader>L :so $MYVIMRC<CR>:runtime! after/plugin/*.vim<CR>:runtime! after/ftplugin/*.vim<CR>
that i should just have it do something similar to treating the entire vimrc as a global augroup and clear that before sourcing the scripts again. I think that I cannot literally do this, because only autocommand-commands should be inside of an augroup, and nested augroups probably are not a thing...
Can this be done? I'm hoping for a feature that just does this, rather than having to programmatically find all set autocommands to clear them one at a time.
autocmd!
.. but no guarantees it doesn't break something somewhereaugroup
'dautocmd
's. However is it best to use a self clearingaugroup
. Use something like:vimgrep /autocmd/ $MYVIMRC
to findautocmd
in yourvimrc
file. Use:cnext
/:cprev
to jump between locations. See:h quickfix
and:h :vimgrep
.