Vim的編譯器插件應該將變量current_compiler
的值設置爲某個值。除非它們用於擴充現有的編譯器插件,否則它們還應該提前退出,如果該變量已經定義的話。是否打算使用該變量的值?它應該設置爲編譯器插件文件的基本名稱嗎? (例如$VIMRUNTIME/compiler/foo.vim
- >foo
)`current_compiler`變量的值的意義
的documentation有這樣說:
To support older Vim versions, the plugins always use "current_compiler" and
not "b:current_compiler". What the command actually does is the following:
- Delete the "current_compiler" and "b:current_compiler" variables.
- Define the "CompilerSet" user command. With "!" it does ":set", without "!"
it does ":setlocal".
- Execute ":runtime! compiler/{name}.vim". The plugins are expected to set
options with "CompilerSet" and set the "current_compiler" variable to the
name of the compiler.
- Delete the "CompilerSet" user command.
- Set "b:current_compiler" to the value of "current_compiler".
- Without "!" the old value of "current_compiler" is restored.
該命令稱爲是:compiler
。它的論點變成了上面使用的{name}
。
writing compiler plugins上的條目沒有提供附加信息,上述條目涵蓋了vim幫助數據庫中的所有字符串current_compiler
(根據:lhelpgrep current_compiler
)的實例。