2

I am looking for ways to open multiple documents in a single application instance. For example, open multiple documents in a single, new gVim instance.

I had found this code on here before, but it doesn't quite do what I want.

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\Open with &Vim]
[HKEY_CLASSES_ROOT\*\Shell\Open with &Vim\command]
@="\"C:\\Users\\avt\\Programs\\PortableApps\\gVimPortable\\gVimPortable.exe\" -p --remote-tab-silent \"%1\" \"%*\""

The problem is that it is giving a similar effect, but not the one I want (it opens the selected documents in an existing gVim instance, not all of them in their OWN new gVim instance). What I want is like this:

  1. Highlight 5 documents in Explorer
  2. Open them
  3. A single gVim instance opens with all 5 documents as tabs

I think this would work, if only I could pass multiple arguments!

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\Open with &Vim]
[HKEY_CLASSES_ROOT\*\Shell\Open with &Vim\command]
@="\"C:\\Users\\avt\\Programs\\PortableApps\\gVimPortable\\gVimPortable.exe\" -p \"%allselecteddocuments\""

Thanks!

EDIT: I just found out I can do this by adding a custom SendTo command (create a shortcut in your SendTo folder to gVim add -p to the Target. Is there any way to do this outside of the SendTo menu?

tau
  • 6,499
  • 10
  • 37
  • 60
  • `vim -p` is what you need & you already know that. So your questions narrows down to "how to pass multiple selected items as single command line, via registry." – anishsane Mar 30 '13 at 06:58
  • Check these: http://stackoverflow.com/questions/1826791/how-to-pass-in-multiple-file-folder-paths-via-a-rigth-click-eventverb-to-an-ex http://stackoverflow.com/questions/10623370/how-do-you-call-multiple-files-from-command-line-into-your-applicaiton – anishsane Mar 30 '13 at 07:19

1 Answers1

0

Create a shortcut in C:\Users\\\<user>\AppData\Roaming\Microsoft\Windows\SendTo folder with ONLY the exe name.

Now you should be able to select random multiple files and use context SendTo\<shortcut> to open them with your designated exe.

SCouto
  • 7,808
  • 5
  • 32
  • 49
Rajeev
  • 1