我正在使用 Vim在 Windows 7 上编辑 Ruby 文件,但我遇到了缩进问题。在我的 Ubuntu 虚拟机上,使用相同的 Vim 设置,Ruby 文件的缩进正确设置为 2 个字符。我不必指定expandtab或设置标签宽度。
我的 _vimrc/.vimrc 文件只是获取默认的 vimrc_example 文件,并且filetype plugin indent设置为on.
这是我在 Windows 上得到的:

如果我输入:filetype,我会得到以下结果:
filetype detection:ON plugin:ON indent:ON
如果我输入:set filetype?,我会得到以下结果:
filetype=ruby
如果我输入:set indentexpr?,我会得到以下结果:
indentexpr=GetRubyIndent()
PS我对PHP也有同样的问题。