:h modeline
says the following:
There are two forms of modelines. The first form:
[text]{white}{vi:|vim:|ex:}[white]{options}
(...)
vi:noai:sw=3 ts=6 ~
vim: tw=77 ~
The second form (this is compatible with some versions of Vi):
[text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
(...)
/* vim: set ai tw=75: */ ~
/* Vim: set ai tw=75: */ ~
The first form appears to be specific to Vim, whilst the second form appears to have some compatibility between different spin-offs of Vi. I am writing coding standards for a package and trying to recommend one form over the other.
The first form is much simpler because it does not need the ending colon but you cannot add text after it, for example if I add the following to a Haskell file:
-- vim: ft=haskell noai --
I get an error!
Error detected while processing modelines:
line 1:
E518: Unknown option: --
So am inclined towards the second form. Yet, given the two versions:
Is the first from Vim (and NeoVim according to my tests) only?
What other spin-offs of Vi support the second form? Does the original Vi support it?