diff runtime/doc/autocmd.txt @ 9653:01c9630e80e0 v7.4.2103

commit https://github.com/vim/vim/commit/e99e84497b89e5f91df519790802770920ecf4fe Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 26 20:43:40 2016 +0200 patch 7.4.2103 Problem: Can't have "augroup END" right after ":au!". Solution: Check for the bar character before the command argument.
author Christian Brabandt <cb@256bit.org>
date Tue, 26 Jul 2016 20:45:06 +0200
parents 42a8a81decdf
children 35ce559b8553
line wrap: on
line diff
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -52,9 +52,6 @@ effects.  Be careful not to destroy your
 ==============================================================================
 2. Defining autocommands				*autocmd-define*
 
-Note: The ":autocmd" command cannot be followed by another command, since any
-'|' is considered part of the command.
-
 							*:au* *:autocmd*
 :au[tocmd] [group] {event} {pat} [nested] {cmd}
 			Add {cmd} to the list of commands that Vim will
@@ -67,6 +64,12 @@ Note: The ":autocmd" command cannot be f
 The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand.
 See |autocmd-buflocal|.
 
+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 * 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
 expanded when the Event is recognized, and the {cmd} is executed.  The only