Bill McCarthy wrote:
Hello Vim Developers,

The help files specifies (see :help modeline):
-----------------------------------------------------------------------------
There are two forms of modelines.  The first form:
        [text]{white}{vi:|vim:|ex:}[white]{options}

[text]          any text or empty
{white}         at least one blank character (<Space> or <Tab>)
{vi:|vim:|ex:}  the string "vi:", "vim:" or "ex:"
[white]         optional white space
{options}       a list of option settings, separated with white space or ':',
                where each part between ':' is the argument for a ":set"
                command
-----------------------------------------------------------------------------

Yet most of the distributed help files fail to follow this
format (and are note second form).

Most end with a ':' which does not appear to be permitted
above.

It is. It just adds an empty do-nothing setting at the end.


Others start with 'vim:' without the mandatory white space
preceding it.

As stated in the following help text, the white space is not mandatory before "vi:" or "vim:" if they start at the left margin. It is still required before "ex:" to reduce the risk of confusion with "example".


Perhaps the docs should mention that {white} is optional if
[text] is empty - if that is true.  And a trailing ':' is
permitted.

It does: Let me quote:

The white space before {vi:|vim:|ex:} is required.  This minimizes the chance
that a normal word like "lex:" is caught.  There is one exception: "vi:" and
"vim:" can also be at the start of the line (for compatibility with version
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3.0).  Using "ex:" at the start of the line will be ignored (this could be
short for "example:").


Also, for the second form, the same comment applies to its
{white}.  It should also be mentioned that the mandatory ':'
is preceded by [white] (optional white space).


That is implicit: a ":set" command can be followed by any amount of whitespace before being terminated by a | " or linebreak.
<quote>
The second form (this is compatible with some versions of Vi):

        [text]{white}{vi:|vim:|ex:}[white]se[t] {options}:[text]

[text]          any text or empty
{white}         at least one blank character (<Space> or <Tab>)
{vi:|vim:|ex:}  the string "vi:", "vim:" or "ex:"
[white]         optional white space
se[t]           the string "set " or "se " (note the space)
{options}       a list of options, separated with white space, which is the
                argument for a ":set" command
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:               a colon
[text]          any text or empty
</quote>

My options.txt is the following:
*options.txt*   For Vim version 7.0.  Last change: 2007 Jan 17


Best regards,
Tony.
--
Am I ranting?  I hope so.  My ranting gets raves.

Reply via email to