Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering how I can modify the gvim.desktop file so that it opens files in new tabs. Also I want it to create a new instance of vim in case it is not supplied with any files(eg. Invoked from the applications menu) similarly to gedit's behaviour.

Any suggestions?

share|improve this question
up vote 1 down vote accepted

The command should be "gvim --remote-tab file1 [file2 ...]". If no instance of gvim is running, it produces an error message (which you won't see if you're not launching it from a terminal anyway) and does what you say.

This command might not work as expected if you open two different gvim windows and then close the first one (instead of opening new tabes in the second one, it'll start a new window). For more details see ":help remote".

share|improve this answer
I look into how gedit works. Apparently it only uses one window with multiple tabs too, even if started without files :D. Guess I was over-complicating things. – vitiv Jul 20 '12 at 13:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.