天天看點

GVIM 标簽

gvim能否隻開一個視窗,每次在終端"gvim 檔案名"的時候就自動在這個視窗新開一個tab page來打開檔案?

這樣桌面簡潔很多,就像windows下用ultraedit一樣。可以在gvim中用:tabnew :e,但太麻煩了。

這樣做:

<code>gvim   --remote-tab-silent  filename</code>

linux下

為了友善可以在.bashrc中加入

<code>alias vim=‘gvim --remote-tab-silent‘ alias gvim=‘gvim --remote-tab-silent‘</code>

windows 下要分2步:

    1) 輕按兩下時打開标簽頁

修改系統資料庫:/hkey_classes_root/applications/gvim.exe/shell/edit/command的值

c:\program files\vim\vim70\gvim.exe -p --remote-tab-silent "%1"

    2)滑鼠右鍵時打開标簽頁

打開系統資料庫,添加以下項:

[hkey_classes_root\*\]下添加shell項      

[hkey_classes_root\*\shell] 下添加edit with &amp;vim項

[hkey_classes_root\*\shell\edit with &amp;vim] 添加command項

[hkey_classes_root\*\shell\edit with &amp;vim\command]修改預設值為"d:\program

files\vim\vim73\gvim.exe" -p --remote-tab-silent "%1"

退出系統資料庫,右鍵顯示edit with vim

繼續閱讀