今天看到$4大的文章:help new-vim-server
果然是好物啊!
發現了原來在win32時用gvim的好功能
只是之前自己一直沒有用心去看help
多虧$4大的文章提醒了我
現在也可以把他做出來了
其實大家在command line底下打上
[huki@pc-huki ~]$ gvim --help
VIM - Vi IMproved 7.1 (2007 May 12, compiled May  4 2008 19:28:36)
..............................
......................................
   --remote <files>    編輯 Vim 伺服器上的 <files> 後離開
   --remote-silent <files>  相同,但沒有伺服器時不警告
   --remote-wait <files>  同 --remote, 但會等候檔案完成編輯
   --remote-wait-silent <files>  相同,但沒伺服器時不警告
   --remote-tab[-wait][-silent] <files>  As --remote but use tab page per file
   --remote-send <keys>    送出 <keys> 到 Vim 伺服器並離開
   --remote-expr <expr>    在伺服器上執行 <expr> 並印出結果
   --serverlist        列出可用的 Vim 伺服器名稱並離開
   --servername <name>    送至/成為 Vim 伺服器 <name>
...........................................
..............................
這裡就有我們需要的東西了


其實只是用一個很簡單的方式
這個方式是給像我們這種很懶得開檔案還要用command line的人使用的(重度的行家請跳過)
原本在/usr/share/applications/裡,有一個gvim.desktop
他的內容我就不多說
我們直接看我們要改的地方
Exec=gvim -f %F改成Exec=gvim --servername GVIM -f %F儲起來
另外再另存一個檔案看你自己要取名為什麼都可以我取名成gvim-existing.desktop
內容只要改兩個

Name=GVim Text Editor
Exec=gvim -f %F
改成
Name=Edit with existing GVim
Exec=gvim --remote-tab %F
改成接下來你只要在你的window manager的檔案管理的程式下加入這兩個desktop
你以為開啟的文檔就可以透過這兩個desktop加入到原來已經開的gvim的new tab裡了
arrow
arrow
    全站熱搜

    huki 發表在 痞客邦 留言(0) 人氣()