summaryrefslogtreecommitdiffstats
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-08-01 14:52:32 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-01 14:52:32 +0200
commit73b8b0ae3acac220e823076f8ca1c14524ed96dd (patch)
tree0b9157946ccfc3a56e621e7e271c97207817a801 /runtime/doc/autocmd.txt
parent6db660bed9ed5063f8c6e0fadeef32d44bbd017d (diff)
patch 8.2.3268: cannot use a block with :autocmd like with :commandv8.2.3268
Problem: Cannot use a block with :autocmd like with :command. Solution: Add support for a {} block after :autocmd. (closes #8620)
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 7614e8bd73..d3ebc11fed 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -76,6 +76,12 @@ and in a `:def` function) then {cmd} will be executed as in Vim9
script. Thus this depends on where the autocmd is defined, not where it is
triggered.
+{cmd} can use a block, like with `:command`, see |:command-repl|. Example: >
+ au BufReadPost *.xml {
+ setlocal matchpairs+=<:>
+ /<start
+ }
+
Note: The ":autocmd" command can only be followed by another command when the
'|' appears before {cmd}. This works: >
:augroup mine | au! BufRead | augroup END