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)
This commit is contained in:
Yegappan Lakshmanan
2022-05-19 10:31:47 +01:00
committed by Bram Moolenaar
parent aaadb5b6f7
commit 1755a91851
9 changed files with 801 additions and 1 deletions

View File

@ -82,6 +82,9 @@ triggered.
/<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 @@ prompt. When one command outputs two messages this can happen anyway.
==============================================================================
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 @@ argument behavior differs from that for defining and removing autocommands.
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: >