gpt4 book ai didi

vim - 这个 : # vim:sw=4:ts=4:et: 的 Vim 功能名称是什么

转载 作者:行者123 更新时间:2023-12-04 00:20:08 25 4
gpt4 key购买 nike

即使在使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com