Is there a way to configure nautilus to open a file into an existing gvim process in a new buffer instead of loading a new instance of gvim? I know I can drag and drop the file into gvim, but it would be convenient if I could just double-click a file to open it.
In a Terminal
cd ~/.local/share/applications
vi gvim-tab.desktop
Copy Paste this code :
[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
In Nautilus
Right-Click in a text file
Open With
Open with a another application
Select "GVim Text Editor (Tabs)"
It's done
You're really just wanting to launch gVim with the --remote-tab-silent option. From the manual:-
*--remote-tab-silent*
--remote-tab-silent
Like --remote-silent but open each file in a new tabpage.
Also just check out --remote-silent if you're not wanting a new tab and want to create a new buffer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With