2012-01-16 78 views
3

我發現vimdiff實用程序只是vim的軟鏈接。兩者都位於我的Suse11盒中的/usr/bin/下。和vimdfiff是vim的軟鏈接。有趣的是,vimdiff file1 file2實際上是vim -d file1 file2等同,所以在這個意義上 的-d選項會自動嵌入在軟鏈接,所以我的問題是如何 簡單?如何實施softlink vimdiff

回答

11

Vim的在其main()函數使用argv[0]來區分它的可執行文件的名稱,其執行該檢查vimvimdiff,或等等

Link to vim main.c分化rvimrviewgvimgviewvimdiffgvimdiffexexim

/* 
* 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. 
*/ 
+1

和'ex','gvim',和'view'等 – Benoit 2012-01-17 14:36:19

+0

Thx Benoit。也包括你的發現。 – 2012-01-17 21:18:56