VIM:鉴于文件类型,set 和 setl 之间的区别

标签 vim

我知道 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/

相关文章:

在 OS X Lion 中为 MacVim 安装 command-t 插件的 Ruby 消息错误

vim - 代码折叠未保存在我的 vimrc 中

vim - 如何编写VIM配色方案?

linux vi 编辑器特殊字符被转换成其他字符

vim - Emacs 备忘单列出了日常 vim 命令的等效项

environment-variables - 如何从gvim中获取环境变量

vim - 有没有办法在 vim 中获取 bool 选项的字符串表示形式?

vim - 有没有类似于 Vim 环绕插件的 Textmate bundle ?

vim 映射键不起作用

vim - vim 有没有办法打开目录及其所有子目录中的所有 .C 和 .H 文件?