即使在使用 Vim 20 年后,我仍然忘记了 Vim 功能的名称,其中编辑器从文件开头(或我认为结尾)的注释中选取配置语句:
# vim:sw=4:ts=4:et:
谢谢提醒!
最佳答案
它被称为模式线
:he modeline
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. 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)
将此添加到 $MYVIMRC:
setglobal modeline
关于vim - 这个 : # vim:sw=4:ts=4:et: 的 Vim 功能名称是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7119824/