documentation patch

25 views
Skip to first unread message

Christian Brabandt

unread,
Mar 15, 2018, 11:53:56 AM3/15/18
to vim...@vim.org
Bram,
currently the documentation at `:h autocmd` uses an example that does
not work. This:
`:autocmd! " comment`

will try to remove all autocommands for the group '" comment' and return
"E216: No such group or event"
So fix that in the documentation and mention, that a comment char will
be seen as part of the group name.

So please include the following patch:

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 678fb378f..ca48004ec 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -56,6 +56,8 @@ effects. Be careful not to destroy your text.
Add {cmd} to the list of commands that Vim will
execute automatically on {event} for a file matching
{pat} |autocmd-patterns|.
+ Note: A quote character is seen as argument to the
+ :autocmd and won't start a comment.
Vim always adds the {cmd} after existing autocommands,
so that the autocommands execute in the order in which
they were given. See |autocmd-nested| for [nested].
@@ -91,7 +93,8 @@ will appear twice. To avoid this, define your autocommands in a group, so
that you can easily clear them: >

augroup vimrc
- autocmd! " Remove all vimrc autocommands
+ " Remove all vimrc autocommands
+ autocmd!
au BufNewFile,BufRead *.html so <sfile>:h/html.vim
augroup END

@@ -145,6 +148,8 @@ prompt. When one command outputs two messages this can happen anyway.
plugins, syntax highlighting, etc.

:au[tocmd]! [group] Remove ALL autocommands.
+ Note: a quote will be seen as argument to the
+ :autocmd and won't start a comment.
Warning: You should normally not do this without a
group, it breaks plugins, syntax highlighting, etc.


Best,
Christian
--
Der Wegreisende glaubt stets, weiter zu sein als der Dableibende.
-- Jean Paul

Bram Moolenaar

unread,
Mar 15, 2018, 5:35:18 PM3/15/18
to vim...@googlegroups.com, Christian Brabandt, vim...@vim.org

Christian wrote:

> currently the documentation at `:h autocmd` uses an example that does
> not work. This:
> `:autocmd! " comment`
>
> will try to remove all autocommands for the group '" comment' and return
> "E216: No such group or event"
> So fix that in the documentation and mention, that a comment char will
> be seen as part of the group name.
>
> So please include the following patch:

Thanks, I'll include it.

--
hundred-and-one symptoms of being an internet addict:
22. You've already visited all the links at Yahoo and you're halfway through
Lycos.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages