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

问题描述 投票:12回答:3

它对我不起作用,我想查看我的配置。也许我在全球范围内将其关闭。但我不知道Google到底要做什么:-)谢谢。

# vim:sw=4:ts=4:et: 
vim
3个回答
19
投票

这叫做Modeline

:he modeline

[如果您开始编辑新文件,并且打开了'modeline'选项,检查文件开头和结尾的行数模式线。模式线有两种形式。

  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

5
投票

这叫Modeline。在帮助中可以通过grepping找到

helpgrep # vim

如果您想检查Modeline是否处于活动状态,请执行set modeline?(如果显示为modeline,否则为nomodeline)] >>

要确定将其关闭,请将其添加到您的vimrc中

:set modelines=0 "number of modelines vim parses
:set nomodeline "turn off parsing

0
投票

[:h 'ts(即:help 'tabstop')将详细说明如何使用ettssw以及指向modeline的指针(modeline是可选的有问题)。

© www.soinside.com 2019 - 2024. All rights reserved.