Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Poster's Solution:</strong></p> <p><strong>Solution:</strong> There is a plugin in the standard distribution of Vim: runtime/macros/editexisting.vim. Just copy it to the Vim plugins directory.</p> <p><strong>Extra details for Visual Studio Integration:</strong> Follow <a href="http://kevin-berridge.blogspot.com/2008/10/vim-to-and-from-visual-studio.html" rel="nofollow noreferrer">these steps</a> to add Vim as an external tool and assign a convenient keyboard shortcut:</p> <ul> <li>Title: Vim</li> <li>Command: C:\Program Files\Vim\vim70\gvim.exe</li> <li>Arguments: +$(CurLine) "$(ItemPath)"</li> <li>Initial directory: $(SolutionDir)</li> </ul> <p>Note I use slightly different settings so the cursor is set to the column from VS and centered in Vim:</p> <ul> <li>Arguments: <strong>+"call cursor($(CurLine),$(CurCol))" +"normal zz"</strong> $(ItemPath)</li> <li>Initial directory: $(FileDir)</li> </ul> <p>Then set VS to <a href="http://vim.wikia.com/wiki/Integrate_gvim_with_Visual_Studio" rel="nofollow noreferrer">automatically load chanages made from Vim</a>:</p> <blockquote> <p>In order to effectively use the two together and make sure .NET does not complain about its files changing, goto Tools > Options > Environment > Documents and ensure these two options are checked: Detect when file is changed outside the environment. Auto-load changes (if not currently modified inside the environment).</p> </blockquote> <p>Finally set Vim to <a href="http://vim.wikia.com/wiki/Calling_gvim_from_MS_Visual_Studio" rel="nofollow noreferrer">automatically load changes made from VS</a>:</p> <blockquote> <p>:set autoread</p> </blockquote> <hr> <p><strong>My Solution</strong></p> <p>Similar, but subtly different: Save this to a .settings file and import. Uses <code>--servername</code> and <code>--remote-call</code> to reuse existing Vim, tailored for the current solution.</p> <pre><code>&lt;UserSettings&gt; &lt;ApplicationIdentity version="8.0"/&gt; &lt;ToolsOptions/&gt; &lt;Category name="Environment_Group" RegisteredName="Environment_Group"&gt; &lt;Category name="Environment_ExternalTools" Category="{E8FAE9E8-FBA2-4474-B134-AB0FFCFB291D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_ExternalTools" PackageName="Visual Studio Environment Package"&gt; &lt;PropertyValue name="edit with v&amp;amp;im.Command"&gt;gvim.exe&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.Arguments"&gt;--servername $(SolutionFileName) --remote-silent +"call cursor($(CurLine),$(CurCol))" "$(ItemFileName)$(ItemExt)"&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.InitialDirectory"&gt;$(ItemDir)&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.SourceKeyName"/&gt; &lt;PropertyValue name="edit with v&amp;amp;im.UseOutputWindow"&gt;false&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.PromptForArguments"&gt;false&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.CloseOnExit"&gt;false&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.IsGUIapp"&gt;true&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.SaveAllDocs"&gt;true&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.UseTaskList"&gt;false&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.Unicode"&gt;false&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.Package"&gt;{00000000-0000-0000-0000-000000000000}&lt;/PropertyValue&gt; &lt;PropertyValue name="edit with v&amp;amp;im.NameID"&gt;0&lt;/PropertyValue&gt; &lt;/Category&gt; &lt;/Category&gt; &lt;/UserSettings&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload