Search code examples
vimconventionmanpage

The use of brackets in VIM help pages


I'm trying to get into the habit of using VIM help pages, and came across the following line when reading about command-line ranges:

/{pattern}[/]   the next line where {pattern} matches     *:/*

Now, my understanding of the help-pages syntactic convention is that [/] marks an optional forward slash character. However, reading further, the following is said about the line above (emphasis mine):

The "/" and "?" after {pattern} are **required** to separate the pattern from
anything that follows.

Am I misunderstanding the syntactic convention?


Solution

  • The "/" and "?" after {pattern} are required to separate the pattern from anything that follows.

    If anything follows (such as an offset, e.g. /foobar/3 to go to the third line after the match), the / after a pattern is required.