This plugin is fantastic, I've used vi and vim forever, and had always hated having to use the Visual Studio editor. Often I would go back and forth between vim for editing outside of VS, and then switching back to the VS editor when I needed the intellisense. You don't know the sense of relief I feel when I using vi within VS, I feel like I'm getting away with something.
This extension has really come a long way. In some ways, it works better than the commercial solution I had previously been using. Great work -- looking forward to many improvements down the road!
It's totally awesome! I've been using VsVim for about a month now and even though there is much to do it's a really terrific project. Are there plans for Microsoft to devote resources to this project? Do we need to start a web campaign to get Scott Gu's attention?
I think this extension is truly awesome despite its inability to emulate certain things in Vim. Keep in mind that the extension is constrained by what is allowed/can be done within the framework of Visual Studio extensibility.
I downloaded and tried to install on “visual studio 11 express for windows developer preview (win 8)”, and failed with a pop up saying “This extension is not installable on any current installed product.”
If it's supporting visual studio 11 beta, then I'll try again there. It's a awesome extension I must install.
Ok the problem there is you're using an express SKU of Visual Studio. The express SKUs don't allow the loading of any meaningful extensions and hence VsVim can't work there. If you download Professional or better it will work
So lovely to be able to use Vim in Visual Studio 2010. I've used VI since 1988 and it's always been a pleasure. In fact I used to carry a DOS version of it around on a floppy disk so I could use it wherever I worked. Now I am using the nearest equivalent to it in 2012. Marvellous! Thank you for VsVim.
Thanks for the review! Note that CTRL-V works on the current released version of VsVim. But given the default behavior of CTRL-V being paste in Windows you have to manually switch the key to be controlled by VsVim. Block insert will be available in 1.2 (already implemented, release should be out in ~2-3 weeks).
Hello,
Is it possible to change VsVim from Insert to Normal mode (or the other way, Normal to Insert) from an addin?
The pre-2010 version of ViEmu had an interface making this possible; unfortunately, ViEmu development seems to have stopped, so the 2010 version won't get this facility.
Thanks.
VsVim is designed as a rich hostable API. The entire plugging in of VsVim to Visual Studio is done with this API so it should be very easy to expose. However I've never actually done the work to make it usable from multiple add-ins. It shouldn't be a ton of work to do though.
Do you have any references to the API your currently using so I can get a better feel for what you're expecting?
Here's what I was using with ViEmu:
// Get the ViEmu service.
// From http://msdn.microsoft.com/en-us/library/bb166423.aspx,
// referred by: http://www.viemu.com/forums/viewtopic.php?pid=2729#p2729
Microsoft.VisualStudio.OLE.Interop.IServiceProvider isp = (IOleServiceProvider) applicationObject;
// GUIDs for the ViEmu service
Guid guidService = new System.Guid("D61C5542-1D52-4731-A789-9A9E5798F052");
Guid guidIviemu = new System.Guid("C93926D3-533A-47BD-A085-DDA86F19D8EC");
IntPtr output;
isp.QueryService(ref guidService, ref guidIviemu, out output);
mViEmuSvc = (ViEmuIfc.IViEmuService2)Marshal.GetObjectForIUnknown(output);
if (null == mViEmuSvc)
{
mOutputWindowPane.OutputString("PROBLEM: ViEmuService NOT found... \n");
}
else
{
mOutputWindowPane.OutputString("ViEmuService found. \n");
}
It's been some time since I wrote that. Here's the relevant forum thread: http://www.viemu.com/forum/viewtopic.php?id=768
Thanks!
... and then this from the ViEmu developer, referring to the current version of ViEmu:
"We'll try to add it in the next version... not with a Service, but as ViEmu-exposed commands. It shouldn't be difficult to offer this API, and then you'd be able to create a VS macro that uses it."
Looked at it a bit this morning. Providing this type of interface is definitely doable. The big issue I need to work out is how it's versioned and the deployment story.
In the meantime I've filed the following issue to track looking at this
https://github.com/jaredpar/VsVim/issues/741
Hi, just grabbed this - looking good!
One thing I've noticed is that numpad asterix doesn't do a current word search - regular vi maps numpad * to do the same as the one on the main keyboard (shift+8 on a UK keyboard), is there any way to map this using vsvim?
Cheers and thanks for the tool!
Hi, First off thank you for such an awesome plugin!
I was wondering if there is a way to disable the ESC key? There are many options under the 'options' button for vsvim/vs control options, but I don't see this one. Is there someway I can give complete control of it to VS like I can many of the other shortcuts? I'm forever escaping out of all the intellisense and I always end up leaving insert mode inadvertently. Plus I prefer ctrl+[ so it works out well :)
It's people like you and projects like this that inspire me to contribute back to open source projects. Keep up the great work. Thanks again!
Glad you're enjoying the product!
Have you considered using a key map to map ESC to say `<nop>` so that it has no effect in Vim? For example ":imap <ESC> <nop>". That should give you the behavior that you're looking for if I understand the problem correctly
Hi, Thanks for the reply!
I gave what you mentioned a shot but no go. I think this is since the ESC is bound via the scan code; as doing so also set Ctrl-[ to <nop> too and I was left with no way to get back to visual mode. I also tried to remap all the ESC keys in VS (i.e. the one under tools > customization > keyboard in VS) to Alt-E, to leave VSVIM the only one using ESC. However, then VSVIM interpreted Alt-E as ESC as well as the actual ESC key and the Ctrl-[ key (so I ended up 3 ESC key mappings). So it had no affect when escaping from the intellisense, still. I then tried to remap Alt-E to <nop> via VSVIM without success using ":imap <A-e> <nop>".
Any other ideas?
I'm using VS2010(japanese ver) and VsVim 1.1.2.0.
VsVim is very useful, great tool for vim user.
But unfortunately, its options dialog seems to don't work on my environment.
Here is a screenshot.
http://uploader.sakura.ne.jp/src/up75714.jpg
I found similar cases.
https://github.com/jaredpar/VsVim/issues/682
https://github.com/jaredpar/VsVim/issues/476
But I couldn't find solution without installing VS english ver.
Could you tell me how to enable "Handle all with VsVim" alternative way?
Thanks for the screenshot. I was able to figure out what's going wrong here and found a potential solution. It should be fixed for the 1.2 release. Hopefully I'll have time tonight to get this into the code base.
What problem are you having when you try and install it? It should be available through the Extension Manager. Also what version of Visual Studio 11 are you using?
It looks like the problem is that you are using the Express SKU of Visual Studio. None of the express SKUs allow 3rd party extensions hence VsVim won't work. You need a non-express version.
Thank you for you geat works. I had set "Handle all with VsVim" and click OK.but it is do not works.when i use CTRL-P still get a print window.
Vs2010
vsvim1.1
Thank you
Thank you for a great tool to give us vim commands under Visual Studio! I see from the release notes that version 1.1 is supposed to support ctrl-p and ctrl-n in edit mode. However, when I press ctrl-p I get a print window and when I press ctrl-n, I get the new file window. How do you remap these keys so they do what they are intended to do for vsvim? Also, how do you bring up the dialog to resolve key conflicts between vsvim and Visual Studio? I though there might be an options window for vsvim under Tools/Extension Manager but I could not find it.
What you need to do is set VsVim as the handler for those key strokes and then it will enable CTRL-P / CTRL-N. To do this click on the "Options" button on the bottom right hand corner. Then click on "Handle all with VsVim" followed by OK. This should move all of the expected key strokes to VsVim's control.
Thank you Jared. For some reason I did not see the "Options" button on the right side. It would be nice if the options setting were listed under the Visual Studio menu Tools / Extension Manager when you select the VsVim extension. The only "options" there are Disable and Uninstall. It would be nice if there was an "Options" setting as well. I assume the options setting is not there because of the way Visual Studio is designed.
Putting it in the actual Options menu is definitely something that's on the plate for a future version. The Visual Studio design allows for this type of integration. It's a bit more expensive but it will come in a future version.
I always have multiple tabs split vertically. VsVim handles tabs fine, but doesn't seem to handle navigating between splits. Is navigation between splits possible with VsVim?
I had just noticed yesterday that CTRL-W,J and CTRL-W,K work when there's a horizontal split in the same file. I was more interested in moving from one file to another; i.e. CTRL-W,H and CTRL-W,L, or even CTRL-W,J and CTRL-W,K when moving between files. Thinking about it a little more than I did last time, I do now realize that with all the possible layout configurations that someone might have, this is probably not as easy as it seems at first glance. So kudos to you for your hard work towards this whole project!
Unfortunately I don't believe that it can. I believe that's an express variant of Visual Studio and express editions don't support loading of any extensions. It's really unfortunate :(
Thanks very much for the fantastic extension. I'm just having one problem... Incremental search doesn't seem to be working. I see plenty of mention on your github of incremental search, so I believe it should be available. However, when I press '/' and start typing, absolutely nothing happens until I press <Enter>. That works fine, as does pressing 'n' after that. I'm just missing the visual feedback.
I'm running version 1.0.3.0 from the gallery. I've tried running vsvim without a vimrc file (in case it was something in there), and I don't have any extensions/themes that mess with the VS interface.
Any ideas where I'm going wrong?
It sounds like you have the `incsearch` option disabled (it's disabled by default in Vim). Once this is enabled you should see the behavior you are looking for. :set incsearch
You rock! Thanks for the answer. Turns out it was my vimrc file not getting loaded, because VSVIM is looking in %USERPROFILE% whereas Vim checks %HOMEDRIVE%%HOMEPATH%. I added a _vimrc to my %USERPROFILE% with a single "source" line and all is good.
(NB: Slightly weirdly, vsvim seems to interpret ~ as being %USERPROFILE% whereas vim interprets it as %HOMEDRIVE%%HOMEPATH%. I see this if I use a "source ~\path\to\vimrc" in a .vimrc file and test it in both... they work differently. Not something I'm at all worried about, but interesting)
I definitely intended to mimic the vim loading behavior and path probing for _vimrc files. Looks like I may've interpreted ~ differently. I'll look into that and see if I can figure out what's going on here.