Vim Tips Wiki
(Move categories to tip template)
(Adjust previous/next navigation)
Line 3: Line 3:
 
|id=946
 
|id=946
 
|previous=945
 
|previous=945
|next=947
+
|next=948
 
|created=June 6, 2005
 
|created=June 6, 2005
 
|complexity=intermediate
 
|complexity=intermediate

Revision as of 03:11, 30 June 2008

Tip 946 Printable Monobook Previous Next

created June 6, 2005 · complexity intermediate · author neil · version 6.0


The VisVim which comes with Vim 6.3 does not work with Visual Studio .NET. Here is an implementation of VisVim for VS.NET :

Setup: http://www.kaoriya.net/testdir/VisVimNET/VisVimNETSetup-20040706.msi

Source Code: http://www.kaoriya.net/testdir/VisVimNET/VisVimNET-20040706.tar.bz2

Looks like this implementation is completely different from the orignal VisVim. It will be great if the original VisVim is modified or this is included in the next Vim release. If you know any other VisVim implementation which works for VS.NET, please post the link here.

Comments

Read README_VisVim.txt in a directory tree of your Vim for help.


When installed, this addin registers a new command ("Open with Vim") but doesn't put it in any menus or toolbars for you. You can add it to a menu or toolbar by using Tools/Customize, go to the Commands tab, select Addins in the left listbox, and scroll down to find "Open with Vim". Now drag that to a menu or toolbar.

Now open a file in VS.NET, move the cursor if you like, and click Open with Vim. It will launch vim and execute :drop for the file you had open in VS.NET. It then moves the currentpoint for vim to the same row and column that you had in VS.NET.

It also adds a section to the properties box called "VisVimNET" with these settings:

[ ] Change directory to file's one
 (means that the cwd of vim will be changed to the parent directory of the file being edited)
[ ] Make Vim foreground application
 (supposed to bring Vim to the front when it executes - didn't work for me though)
[ ] Set cursor at center of window
 (executes zz after moving to the current row and column)
[ ] Synchronize with activated window
 (if this is checked, then each time you change files in VS.NET, commands will be sent to vim to put you in the same file.)
 

Naturally, when you save a file in vim and then switch to VS.NET, VS.NET will detect that you changed the file and ask to reload it. And vice-versa.

It's pretty good, actually.


It's also very easy, in .NET, to add an External Tool having this command line:

--servername=gmain --remote-silent +$(CurLine) +"normal zz" $(ItemPath)

and:

$(ItemDir)

as the initial directory. The problem isn't with launching Vim from .NET, its not a problem, Vim is well made and behaves correctly. The problem is sending files from Vim to .NET. For that, there is already a tip explaining the procedure (VimTip580); its a bit of a hack but works great.


I just noticed that it did install in VS 2003, but not in VS 2005. Any direction would be appreciated.


The link doesn't work for me.