我知道 VIM 在 set
之间有所不同和 setl
因为第一个为所有缓冲区设置一个选项,而后一个为当前缓冲区设置选项。如果我做了一个 :set tw=80
,这很明显。而不是 :setl tw=80
.
现在,当我做 :set ft=plsql
,虽然我没有做 setl
,但它只在当前缓冲区上运行.这当然是有道理的。然而,我没有看到这是否在某处记录。所以,问题可能归结为:默认情况下,是否有选项在当前缓冲区上运行,而其他选项在“无处不在”运行,并且记录在哪里?
最佳答案
确实存在对当前缓冲区(在某些情况下确实是当前窗口)进行操作的选项。该文档与该选项的文档一起提供。如果您转到 :help option-list
中的任何选项,它将具有以下三个字符串之一作为第三行:
global
local to window
local to buffer
(或它们的某种组合)。例如,
: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.
所以这个选项是缓冲区的本地选项。更多讨论见:
:help option-summary
关于VIM:鉴于文件类型,set 和 setl 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4681548/