Re: ViEmu not working in XML Editor

it seems the ViEmu does not work in the XML Editor.  When ViEmu is in normal mode and I type "x" the character under the cursor is not deleted by a "x" is inserted. Trying to get rid of the "x" by using backspace does not work - Backspace has no effect at all. I have to go one char to the left and use DEL.
The xml file is part of a project. ViEmu works fine for the C# files in the same project.

By the way: Great tool! I've started to use vim as my default editor since I picked up ViEmu. Thanks to you I am closer to the goal stated in Pragmatic Programmer Tip 22: "Use a single Editor Well", so I still have a long way to go.


Here is the VS2005 version info:

Microsoft Visual Studio 2005
Version 8.0.50727.762  (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Professional

Microsoft Visual Basic 2005   77626-009-0000007-41806
Microsoft Visual Basic 2005

Microsoft Visual C# 2005   77626-009-0000007-41806
Microsoft Visual C# 2005

Microsoft Visual C++ 2005   77626-009-0000007-41806
Microsoft Visual C++ 2005

Microsoft Visual J# 2005   77626-009-0000007-41806
Microsoft Visual J# 2005

Microsoft Visual Web Developer 2005   77626-009-0000007-41806
Microsoft Visual Web Developer 2005

Microsoft Web Application Projects 2005   77626-009-0000007-41806
Microsoft Web Application Projects 2005
Version 8.0.50727.762

Crystal Reports    AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005

Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack 1 (KB926601)   
This service pack is for Microsoft Visual Studio 2005 Professional Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/926601

NGEDIT Software's ViEmu   v2.1.13
ViEmu 2.1 - vi/vim editor emulation for Microsoft(TM) Visual Studio(TM)
(c) 2005-2006 NGEDIT Software (www.ngedit.com)

ReSharper 3.0   Full Edition build 3.0.468.6 on 2007-06-21T10:34:16
ReSharper add-in for Microsoft Visual Studio. For more information about ReSharper, see the ReSharper website at http://www.jetbrains.com/resharper. Copyright © 2003–2007 JetBrains, Inc

SlickEdit Gadgets 1.0   SlickEdit Gadgets
Installed Packages: CommandSpy , Editor Gadgets , SLOC Graph , IDataObject Analyzer , File Explorer
Build date:  12.28.2006 16:36

SQL Server Analysis Services   
Microsoft SQL Server Analysis Services Designer
Version 9.00.3042.00

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 9.00.1399.00

SQL Server Reporting Services   
Microsoft SQL Server Reporting Services Designers
Version 9.00.1399.00

TestDriven.NET 2.7.2111 Beta Personal
For more information, see the TestDriven.NET website at http://www.testdriven.net/. Development by Jamie Cansdale <jamie@mutantdesign.co.uk>.  Copyright (c) 2002-2006 Mutant Design.


Re: ViEmu not working in XML Editor

Hi Ralf,

Thanks for the detailed info. It's almost sure due to some interaction with one of the other plug-ins - ViEmu works fine with XML both in VS.NET 2003 and VS2005. I will try to get access to trial versions of those add-ins to try and understand which one is causing the problem (or it may even be a three-way interaction), hopefully they will have trial versions available. If you can track it down by uninstalling them it would be great, but I'll try it out myself anyway (it will take a few days, as I'm completely swamped with other things right now).

Thanks for the kind comment and best regards,



Re: ViEmu not working in XML Editor

Hi Jon,
thanks for the quick reply.
I've tried to switch off the various Add-Ins. When I switch off Resharper, exit VS and restart it, ViEmu works correctly in xml files. I can even restart the Resharper Add-in and ViEmu still works. Only when ReSharper is already activated on startup the behavior described in my previous message can be observed.

BTW: I've changed the keys to be scanned to "FBDUQYOINP]" to avoid collisions with my ReSharper shortcuts (I use the "Visual Studio" ReShaper shortcuts, not the "ReSharper 2.x or IntelliJ IDEA" ones). So maybe that is the source of the problems I have noticed.

Maybe this is of some help to you. And do not worry to much about it: I hate editing xml files anyway ;-).



Re: ViEmu not working in XML Editor

Hi Ralf,

I think the developers of Resharper added XML/HTML in one of the latest versions. There might be some incompatibility due to this. The sensitivity to activation order is understandable too, ViEmu needs to be at the top of the window subclassing stack, in order to get the keys first - as it is the only plug-in that really changes the meaning of keypresses.

I think the best solution is something that I intend to implement anyway for the next major version of ViEmu: hooking keypress events via a windows hook, instead of by subclassing the window and using VS's framework. This is the same method that ViEmu for Word and Outlook uses, and it has many advantages in coexisting with both the host application's keypress managament and with other add-ins.




Re: ViEmu not working in XML Editor

Sort-of related, so I thought I'd post in this thread:

I often use visual-line select mode to highlight a chunk of text and then comment/uncomment it using the Visual Studio keystrokes. I recently installed Visual Assist X, and since then, if I try and highlight more than one line while editing an XML file, the selection becomes un-selected, if that makes sense. If I disable VAX, it works fine.... any ideas/workarounds?

Thanks in advance,


Re: ViEmu not working in XML Editor

hereschenes, I don't really think the issue is related.

How is the "Use Visual Studio selection for Visual Mode" setting in your Tools|Options|ViEmu? Changing that may easily make a difference or fix it.

Also, can you please explain better what you mean with "the selection becomes un-selected"? Screenshots or a detailed explanation might help me understand the issue better.


  -- Jon


Re: ViEmu not working in XML Editor

Hi Jon - sorry for my previous cryptic explanation. Changing the setting you mentioned does seem to have fixed the problem - it was set to on, and I've just turned it off.

Just by way of explaining what I meant before: when I edit an XML document with VAX 10.5.1711.0 enabled (and the ViEmu setting you mentioned set to 'on') and enter the following keystrokes whilst in normal mode:


the result is:

- after <Shift-V>, ViEmu enters 'Visual Line' mode and highlights the current line, as expected. The cursor moves down to the next line, also as expected.
- after the first j, the line that had been highlighted is no-longer highlighted, and the line under it remains un-highlighted; ViEmu still reports 'Visual Line' mode. The cursor moves down to the next line, as expected.
- after the second j, no lines are highlighted; ViEmu reports 'Normal' mode. The cursor moves down to the next line, as expected.

nb. Editing a C++ header/source file does not exhibit the same problem - visual line mode works as advertised.

Hope that makes sense!


Re: ViEmu not working in XML Editor

Hereschenes, I've been able to reproduce this. I think it has started to happen with the latest versions of Visual Assist, as they now intercept HTML and XML windows (which they didn't use to). ViEmu has to take different measures in both cases, and there is no way to tell in advance, so I just have to chase what VAX does. I'll try to prepare a new version of ViEmu which fixes this and release it later today. I'll post about it here.

Can you post what VAX build / version number you are using?

In any case, after this is solved, I'd suggest you don't use the "use visual selection for visual mode" setting unless completely necessary (like in this case before I fix it, or in other 3rd-party interaction cases). Visual mode emulation is much better when that setting is turned off.


  -- Jon


Re: ViEmu not working in XML Editor

hereschenes, I've built & released 2.2.7 which fixes this problem, details here:



  -- Jon


Re: ViEmu not working in XML Editor

Thanks Jon - working fine for me now. FYI, I'm using VAX 10.5.1711.0, built 2008.12.11.

One minor thing with the new build - the files I have been working on are actually XRC files (wxWidgets resource files) which are XML files that typically have the extension .xrc instead of .xml. If I fire up a new Visual Studio session and attempt to edit a .xrc file first up, ViEmu does not activate at all. If I switch to a .cpp/.h file, ViEmu activates, and then if I switch back to editing the .xrc file, ViEmu is still active. If I initially edit a file with a name that actually ends in .xml, there is no problem.

It's not a big hassle for me or anything, but just thought you'd be interested to know.



Re: ViEmu not working in XML Editor

Ben, glad to know it works fine now. The XRC glitch can be related to the mess that VS and Visual Assist make of different file types, etc... if it doesn't generate any more trouble, I will leave it "as is". Drop me a line if it becomes problematic.

Best regards,

  - Jon