2009-08-24 88 views
7

有沒有辦法配置nautilus在新的緩衝區中打開文件到現有的gvim進程而不是加載gvim的新實例?我知道我可以將文件拖放到gvim中,但是如果我只需雙擊一個文件就可以打開文件。讓nautilus打開文件到新的gvim緩衝區中?

回答

17

在終端

cd ~/.local/share/applications 
vi gvim-tab.desktop 

複製粘貼此代碼:

[Desktop Entry] 
Encoding=UTF-8 
Name=GVim Text Editor (Tabs) 
Comment=Edit text files in a new tab 
Exec=gvim --remote-tab %F 
Terminal=false 
Type=Application 
Icon=/usr/share/pixmaps/vim.svg 
Categories=Application;Utility;TextEditor; 
StartupNotify=true 
MimeType=text/plain; 
NoDisplay=true 

在鸚鵡螺

Right-Click in a text file 
Open With 
Open with a another application 
Select "GVim Text Editor (Tabs)" 

它的完成

+0

真棒 - 正是我想弄明白!謝謝! :D – CMB 2009-09-08 15:01:59

+1

這對我來說真的很好,除了上面的配置長時間以來我的光標變成了微調器。要修復它,我在桌面條目中更改了'StartupNotify = false'。 http://developer.gnome.org/integration-guide/stable/startup-notification.html.zh – Johann 2012-03-29 18:22:42

+0

謝謝!你搖滾! – Costa 2013-03-12 03:52:56

0

也許你可以編寫一個shell腳本來自動化這個,如果Gvim提供了這個功能的話。我個人不知道提供詳細信息。只是一個嘗試的方向?

3

你真的只是想用--remote-tab-silent選項啓動gVim。從the manual: -

      *--remote-tab-silent* 
    --remote-tab-silent 
    Like --remote-silent but open each file in a new tabpage. 

也只是檢查出--remote沉默,如果你不想要一個新的標籤,並希望創建一個新的緩衝。

+0

其中GNOME配置將對哪些程序相關聯的任何想法文本文件?系統 - >首選項 - >首選應用程序似乎是正確的區域,但它不允許你在那裏選擇文本編輯器。 。 。 – CMB 2009-08-24 18:59:18

+0

我在Mac上,所以我不是100%,但你可以試試這個: - http://www.howtogeek.com/howto/ubuntu/add-open-with-gedit-to-the-right-點擊菜單在Ubuntu的/並使用此腳本,而不是: - http://pastebin.com/m7abf308e它可能會伎倆。 – 2009-08-24 19:30:24

+0

謝謝你,我使用緩衝區而不是標籤頁。 – Costa 2014-01-15 17:22:50

相關問題