2012年3月16日 星期五

設定Source Insight在已經存在的視窗打開檔案

在一些軟體可以使用快速鍵指定特定的編輯器開啟目前選擇的檔案~
例如在Beyond Compare、或是FreeCommander~

但是,如果不特別設定的話,每一次透過編輯器開啟一個檔案,
都會開啟一個新的編輯器視窗,
如果一次開啟多個檔案的話,就會存在很多個視窗~
這樣整個環境就會超亂的~

在vim的話,在開啟檔案的時候,加入特別的指令,
就會尋找目前是否有開啟視窗,
若有的話,就會使用目前開啟的視窗建立一個tab windows來開啟目前指定的檔案。
可以參考FreeCommander & MDIE

但是,目前跟VIM比較起來,還是比較多人熟悉Source Insight~
在找過Source Insight Help後,
可以使用以下指令去完成以上的動作。

=*=*=*=*=*=*=*=*=*=*=
Suppressing New Program Instances

-i <rest of command line>

This option will direct the rest of the command line to an already running instance of Source Insight, if any. If there are no instances already running, then a new instance is started.

Example:

insight3 –i myfile.cpp

This will locate an already running instance of Source Insight, and tell it to open myfile.cpp.
=*=*=*=*=*=*=*=*=*=*=

沒有留言: