<p>I am trying to get the <code>Edit with Vim</code> context menu to open files in a new tab of the previously opened Gvim instance (if any).</p>

<p>Currently, using <code>Regedit</code> I have modified this key:</p>

<pre><code>\HKEY-LOCAL-MACHINE\SOFTWARE\Vim\Gvim\path = "C:\Programs\Vim\vim72\gvim.exe" -p --remote-tab-silent "%*"
</code></pre>

<p>The registry key type is <code>REG_SZ</code>.</p>

<p>This almost works... Currently it opens the file in a new tab, but it also opens another tab (which is the active tab) the tab is labeled <code>\W\S\--literal</code> and the file seems to be trying to open the following file. </p>

<pre><code>C:\Windows\System32\--literal
</code></pre>

<p>I think the problem is around the <code>"%*"</code> - I tried changing that to <code>"%1"</code> but if i do that I get an extra tab called <code>%1</code>.</p>

<p><strong>Affected version</strong></p>

<ul>
<li>Vim version 7.2 (same behaviour on 7.1) </li>
<li>Windows vista home premium</li>
</ul>

<p>Thanks for any help. </p>

<p>David. </p>

[{'answer_id': 69920, 'author': 'kobusb', 'author_id': 1620, 'author_profile': 'https://Stackoverflow.com/users/1620', 'pm_score': 4, 'selected': True, 'text': '<p>Try setting it to: "C:\\Programs\\Vim \\vim72\\gvim.exe" -p --remote-tab-silent "%1" "%*"</p>\n\n<p>See: <a href="http://www.vim.org/tips/tip.php?tip_id=1314" rel="noreferrer">http://www.vim.org/tips/tip.php?tip_id=1314</a></p>\n\n<p>EDIT: As pointed out by Thomas, vim.org tips moved to: <a href="http://vim.wikia.com/" rel="noreferrer">http://vim.wikia.com/</a></p>\n\n<p>See: <a href="http://vim.wikia.com/wiki/Add_open-in-tabs_context_menu_for_Windows" rel="noreferrer">http://vim.wikia.com/wiki/Add_open-in-tabs_context_menu_for_Windows</a></p>\n'}, {'answer_id': 70588, 'author': 'Lord Future', 'author_id': 978, 'author_profile': 'https://Stackoverflow.com/users/978', 'pm_score': 1, 'selected': False, 'text': '<p>I would recommend trying <a href="http://cream.sourceforge.net/index.html" rel="nofollow noreferrer">Cream</a>.</p>\n\n<p> Cream is a set of scripts and add-ons that sit on top of gVim. Cream doesn\'t change the appearance of gVim, but it does change the way it behaves.</p>\n\n<p>One of those behaviours is a tabbed document interface. Other behaviours are listed <a href="http://cream.sourceforge.net/featurelist.html" rel="nofollow noreferrer">here</a>. The downloads page is <a href="http://cream.sourceforge.net/download.html" rel="nofollow noreferrer">here</a>.</p>\n'}, {'answer_id': 78234, 'author': 'David Turner', 'author_id': 10171, 'author_profile': 'https://Stackoverflow.com/users/10171', 'pm_score': 2, 'selected': False, 'text': '<p>I found the answer... The link to cream gave me some additional areas to search around.</p>\n\n<p>from <a href="http://genotrance.wordpress.com/2008/02/04/my-vim-customization/" rel="nofollow noreferrer">http://genotrance.wordpress.com/2008/02/04/my-vim-customization/</a> there is a vim.reg registry file that contains the following</p>\n\n<pre><code>Windows Registry Editor Version 5.00\n\n[HKEY_CLASSES_ROOT\\*\\shell\\Edit with Vim]\n@=""\n\n[HKEY_CLASSES_ROOT\\*\\shell\\Edit with Vim\\command]\n@="\\"C:\\\\Programs\\\\vim\\\\vim72\\\\gvim.exe\\" -p --remote-tab-silent \\"%1\\" \\"%*\\""\n\n[HKEY_CLASSES_ROOT\\Applications\\gvim.exe\\shell\\open\\command]\n@="\\"C:\\\\Programs\\\\vim\\\\vim72\\\\gvim.exe\\" -p --remote-tab-silent \\"%1\\" \\"%*\\""\n</code></pre>\n\n<p>this gives me the behaviour I want.</p>\n\n<p>So I guess my original plan of editing the HKEY_LOCAL_MACHINE was just wrong.</p>\n\n<p>Would also be nice to know what exactly what the "%1" and "%*" mean/ refer to.</p>\n\n<p>Now... should I edit my original question, to show that I was starting off in the wrong registry area?</p>\n'}, {'answer_id': 1725842, 'author': 'Krishna', 'author_id': 210010, 'author_profile': 'https://Stackoverflow.com/users/210010', 'pm_score': 2, 'selected': False, 'text': '<p>You were on the right track:</p>\n\n<pre><code>HKEY-LOCAL-MACHINE\\SOFTWARE\\Vim\\Gvim\\path = "C:\\Programs\\Vim \\vim72\\gvim.exe" -p\n</code></pre>\n\n<p>was sufficient ... it works!!</p>\n'}, {'answer_id': 20655637, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>There is an even cleaner fix using your <code>_vimrc</code>. Add the following line:<br>\n<code>autocmd BufReadPost * tab ball</code><br>\nfrom <a href="http://www.vim.org/scripts/script.php?script_id=1720" rel="nofollow">http://www.vim.org/scripts/script.php?script_id=1720</a></p>\n'}]
['https://Stackoverflow.com/questions/67518', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10171/']