summaryrefslogtreecommitdiffstats
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index e1e96a770b..06931dfd32 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 8.0. Last change: 2017 Oct 21
+*autocmd.txt* For Vim version 8.0. Last change: 2017 Nov 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -68,7 +68,14 @@ Note: The ":autocmd" command can only be followed by another command when the
'|' appears before {cmd}. This works: >
:augroup mine | au! BufRead | augroup END
But this sees "augroup" as part of the defined command: >
+ :augroup mine | au! BufRead * | augroup END
:augroup mine | au BufRead * set tw=70 | augroup END
+Instead you can put the group name into the command: >
+ :au! mine BufRead *
+ :au mine BufRead * set tw=70
+Or use `:execute`: >
+ :augroup mine | exe "au! BufRead *" | augroup END
+ :augroup mine | exe "au BufRead * set tw=70" | augroup END
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
arguments are not expanded when the autocommand is defined. These will be