Take the 2-minute tour ×
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.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.