我发现该vimdiff实用程序只是vim的软链接.这两个都位于/usr/bin/我的Suse11盒子下面.并且vimdfiff是vim的软链接.有趣的是,vimdiff file1 file2实际上是等价的vim -d file1 file2,所以在这个意义上,该-d选项会自动嵌入到软链接中,所以我的问题就像How一样简单?
Raj*_*n T 11
VIM在其main()功能用途argv[0]来区分它的可执行文件的名称vim或vimdiff,或等.
vim的一个链接的main.c 执行此检查来区分rvim,rview,gvim,gview,vimdiff,gvimdiff,ex,exim.
/*
* Check for: [r][e][g][vi|vim|view][diff][ex[im]]
* If the next character is "e" we run in Easy mode.
* If the next character is "g" we run the GUI version.
* If the next characters are "view" we start in readonly mode.
* If the next characters are "diff" or "vimdiff" we start in diff mode.
* If the next characters are "ex" we start in Ex mode. If it's followed
* by "im" use improved Ex mode.
*/
Run Code Online (Sandbox Code Playgroud)