在安装了Vim 7.2和7.3之间的机器之间,我将使用相同的.vimrc文件。 Vim 7.2的机器每次打开文件时都会抱怨我的7.3特定选项:
Error detected while processing /home/spiffytech/.vimrc: line 72: E518: Unknown option: rnu line 73: E518: Unknown option: undofile line 74: E518: Unknown option: undodir=/tmp line 75: E518: Unknown option: cryptmethod=blowfish Press ENTER or type command to continue
将新选项包含在:
if version >= 703 set rnu ... endif
请查看有关v:version的帮助,以获取有关要使用的版本号的更多信息:
*v:version* *version-variable* v:version Version number of Vim: Major version number times 100 plus minor version number. Version 5.0 is 500. Version 5.1 (5.01) is 501. Read-only. "version" also works,for backwards compatibility. Use |has()| to check if a certain patch was included,e.g.: > if has("patch123") < Note that patch numbers are specific to the version,thus both version 5.0 and 5.1 may have a patch 123,but these are completely different.