Monday, October 24, 2011

Running gVim as a single instance

I want it in such a way that on double clicking an already opened file, or a new file, gVim uses the same window. From this question asked previously on Stackoverflow (http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instance) I figured out how to do this by putting up an alias like:

alias gvim="gvim --remote-tab-silent" || gvim

This works great for the terminal without any problems. To enable this for the desktop too, I tried editing the /usr/share/applications/gvim.desktop. The default execution command in gvim.desktop is:

gvim -f %F

I changed this to:

gvim --remote-tab-silent %F

This gives me trouble when I'm trying to open an already opened file. It takes too long to open and doesn't open in the end. What may have caused the problem? I'm running Gnome 2.x and Vim 7.2.x if it matters. I also tried compiling Vim 7.3 on another machine and the problem still exists.

The Vim Wikia (http://vim.wikia.com/wiki/Launch_files_in_new_tabs_under_Unix) suggests using:

gvim -p --remote-tab-silent %F 


as the execution command in gvim.desktop. This too does not work.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: