Sunday, August 20, 2017

Re: autocmd! followed by

Am 19.08.2017 um 08:17 schrieb Lifepillar:
> It seems impossible to have autocmd! followed by another command, i.e.:
>
> autocmd! some_group | <whatever I put here is ignored>
>
> According to `:help autocmd`, autocmd may be followed by another command
> when the '|' appears before {cmd}. This does not seem to be the case for
> autocmd!. Is that intentional?

Help says "this works":
:augroup mine | au! BufRead | augroup END

but it doesn't (augroup "mine" still active afterwards), thus it can't be
intentional and you found a bug.

Also not working:
:augroup mine | au! BufRead *| augroup END
" `*|' is taken as autocmd-{pat}, `augroup END' becomes {cmd}

:augroup mine | au! BufRead * | augroup END
" uses `| augroup END' for {cmd}

Weird that it went unnoticed for so long, probably because most people
instead use
:au! mine BufRead

I think Vim should make anything after `:au' part of the command.
`:au' is already listed under `:h :bar' without further notice.

--
Andy

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment