Под :help auto-setting
вы найдете этот параграф:
3. If you start editing a new file, and the 'modeline' option is on, a
number of lines at the beginning and end of the file are checked for
modelines. This is explained here.
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 (can be empty)
Example:
vi:noai:sw=3 ts=6 ~
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
Example:
/* vim: set ai tw=75: */ ~
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:").
Так что, вероятно, в вашем ~ / .vimrc у вас есть set nomodeline
.
Строка, читающая vi: bad line
, пытается установить опции bad
и line
, которые не могут быть установлены, следовательно, ошибка.
РЕДАКТИРОВАТЬ : Как указано в jamessan'S answer (+1), опция modeline
устанавливается через настройку nocompatible простым существованием ~/.vimrc
.