VIM:文件类型中set和setl之间的差异

Ren*_*ger 7 vim

据我所知,VIM,使之间的差异set,并setl在后者一个设置选项皮草的第一个设置所有缓冲区的选项目前只缓冲.如果我做了一个:set tw=80而不是一个,这是显而易见的:setl tw=80.

现在,当我这样做时:set ft=plsql,它只会操作当前的缓冲区,尽管我没有这样做setl.当然,这是有道理的.然而,我没有看到是否在某处记录了这一点.因此,问题可能归结为:是否存在默认情况下在当前缓冲区上运行而其他选项在"无处不在"运行的选项以及记录在哪里的选项?

DrA*_*rAl 11

确实有选项在当前缓冲区上运行(在某些情况下确实是当前窗口).该文档包含该选项的文档.如果您转到任何选项:help option-list,它将具有以下三个字符串之一作为第三行:

global
local to window
local to buffer
Run Code Online (Sandbox Code Playgroud)

(或它们的某种组合).例如,:help 'ft'给出:

                    *'filetype'* *'ft'*
'filetype' 'ft'     string (default: "")
            local to buffer
            {not in Vi}
            {not available when compiled without the |+autocmd|
            feature}
    When this option is set, the FileType autocommand event is triggered.
    All autocommands that match with the value of this option will be
    executed.  Thus the value of 'filetype' is used in place of the file
    name.
Run Code Online (Sandbox Code Playgroud)

所以这个选项是缓冲区的本地选项.有关更多讨论,请参阅:

:help option-summary
Run Code Online (Sandbox Code Playgroud)