views:

359

answers:

3

I'd like gVim to open files dragged into it to open in a new tab, instead of replacing the current file. This question is on the right track, but I'd like to be able to run multiple instances of gVim, just able to drag files to the window I want.

I'm running on Windows 7.

+2  A: 

You can start by typing :tabe and then drag and drop your file. I can't fully confirm this (I only have a mac) but I think this will end up with :tabe filename displayed. You can then hit enter and off you go...

Peter
That works, but I'd rather not have to "prepare" the editor to get a new file. Is there a way to make that the default action for a 'drop'?
wes
ok, try my other answer on for size :)
Peter
+2  A: 

No you cannot, the default action on drag and drop is specified in the implementation of a windows application (OLE DoDragDrop). It has not been implemented to open dropped files in a new tab and thus won't. But gVim is open source... so you could submit a patch if you really want this :)

Pierre-Antoine LaFayette
+1  A: 

Opening a new file in gvim doesn't replace the one that's currently open. The new file is opened in a new buffer and that buffer is show. You can switch between buffers using the :b command. In your case, you can simply drop the file, then create a new tab with :tabedit, and switch that tabs buffer to the one you want with :b <filename>. Of course that's not exactly what you're searching for, but it's sufficient for me.

bluebrother