Documentation for /ordinary-atom missing \*?

0 views
Skip to first unread message

Nico Weber

unread,
Jan 13, 2008, 4:41:06 PM1/13/08
to vim...@googlegroups.com
Hi,

you can use '\*' to match a literal '*' (with 'magic' set). I can't
find this mentioned anywhere in the documentation. User error or
missing documentation?

Thanks,
Nico

Tony Mechelynck

unread,
Jan 13, 2008, 5:19:56 PM1/13/08
to vim...@googlegroups.com

It might be useful to mention it there, but it is not really missing: look
under ":help /magic" and you'll see:

> 3. Magic */magic*
>
> Some characters in the pattern are taken literally. They match with the same
> character in the text. When preceded with a backslash however, these
> characters get a special meaning.
>
> Other characters have a special meaning without a backslash. They need to be
> preceded with a backslash to match literally.
>
> If a character is taken literally or not depends on the 'magic' option and the
> items mentioned next.

IOW, any character which (like *) has a special meaning in a pattern when it's
not backslash-escaped, will match itself when it is, and any character which
has a special meaning when it is, will match itself when it isn't. Which is
which depends on the 'magic' option, and on whether atoms in the pattern
itself set it to very magic, magic, nomagic or very nomagic.


Best regards,
Tony.
--
Quidquid latine dictum sit, altum viditur.

(Whatever is said in Latin sounds profound.)

Reply all
Reply to author
Forward
0 new messages