patch 8.2.4981: it is not possible to manipulate autocommands
Problem: It is not possible to manipulate autocommands.
Solution: Add functions to add, get and set autocommands. (Yegappan
Lakshmanan, closes #10291)
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 0bbfd34..fb4532f 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -82,6 +82,9 @@
/<start
}
+The |autocmd_add()| function can be used to add a list of autocmds and autocmd
+groups from a Vim script.
+
Note: The ":autocmd" command can only be followed by another command when the
'|' appears where the pattern is expected. This works: >
:augroup mine | au! BufRead | augroup END
@@ -146,6 +149,9 @@
==============================================================================
3. Removing autocommands *autocmd-remove*
+In addition to the below described commands, the |autocmd_delete()| function can
+be used to remove a list of autocmds and autocmd groups from a Vim script.
+
:au[tocmd]! [group] {event} {aupat} [++once] [++nested] {cmd}
Remove all autocommands associated with {event} and
{aupat}, and add the command {cmd}.
@@ -198,6 +204,9 @@
In order to list buffer-local autocommands, use a pattern in the form <buffer>
or <buffer=N>. See |autocmd-buflocal|.
+The |autocmd_get()| function can be used from a Vim script to get a list of
+autocmds.
+
*:autocmd-verbose*
When 'verbose' is non-zero, listing an autocommand will also display where it
was last defined. Example: >