Vim Emulator Editor Extension Released


I just released version 0.5.0 of VsVim: a vim emulation editor extension for Visual Studio 2010 Beta1 written in F#.  This is a hobby project I’ve been working on for awhile now.  I expect to continue updating this release as time goes on as I use it on a daily basis and I’m interested in getting back feedback from users on it.  

Link: http://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329 

Here’s a quick break down on the state of this project

Caveats and Expectations

This extension is being released by me, not by Microsoft.  As such the support level for this extension is equivalent to the amount of free time I have to put into it. 

Quality Level

I would classify this as a Beta style release.  I use this extension every day and I have a very large test bed to verify functionality.  There are still several known bugs (detailed below) and little quirks I’m working on.  But they are mostly minor issues

What’s Implemented

At this point the engine has an Insert, Normal and Command mode. 

  • Insert Mode
    • Basic insertion layer which allows for typing.  No special insert mode commands are implemented
  • Normal Mode.
    • Movement Commands: h,j,k,l,w,b,$,^,n,*,#
    • Edit Commands: x,X,d,p,P,A,u,<,>,o
    • Incremental Search
  • Command Mode
    • :e
    • Jump to line
    • Beginning / end of line

Deviations

The biggest deviation I made from a traditional VIM engine is that I am using .Net regular expressions instead of VIM style regular expressions.  This allowed me to focus on getting a lot of features written vs. spending time building a regular expression engine.  Getting this working will be a focus of a later release. 

Another issue is the cursor.  As flexible as the new editor is, one part that is very tricky is changing the appearance of the cursor.  So making a block style cursor for normal mode was not done for this release.  Instead I simply color the cursor red for normal mode and black for insert mode.  This will be fixed in a later release.

Bugs

Below is the list of known issues for the extension.  I’ve noted all bugs for which I cannot get a steady repro.  If you can find one I would appreciate you emailing the steps to me. 

  • Cursor appearance in normal mode is not a block cursor but instead a red cursor
  • Need Repro: Using ‘o’ in normal mode can cause the line ending to switch from \r\n to \r or \n.
  • Both ‘#’ and ‘*’ match partial words instead of full words
  • Register list is limited to standard a-z alphabet

What’s next?

Thus far I’ve been working on features which don’t conflict with existing Visual Studio key bindings.  The next big release will be focusing on the infrastructure needed to integrate these commands smoothly into the core Vim engine and Visual Studio itself.  This will allow me to expand the number of implemented features a great deal. 

Where’s the source?

Should be released soon.  Right now I’m working out where I should host this project long term.  Preferably a place where users can file bugs and leave feedback. 


 

Comments (17)

  1. Richard says:

    Awesome, I can’t wait for VS 2010 now. Personally, I would be happy with the .NET regular expressions. If I’m going to be programming in a .NET language reinforcing the syntax for the .NET engine makes sense for me.

  2. Zach says:

    This is pretty interesting.  I wrote a VIM extension for Visual Studio 2005 a while ago but the extensibility model back then was orders of magnitude simpler than what we have now.  It required some amazing hacks and it was so complicated I never took it past being able to switch from insert mode to command mode and enter a few basic commands.  

  3. Ian Banks says:

    Not to be discouraging, but have you seen ViEmu? I presume if the Visual Studio 2010 extensibility isn’t completely different there will be a version of ViEmu with support fairly soon.

    It is done by a single developer (to the best of my knowledge) but he uses the proceeds of ViEmu to develop it full time and work out all the nasty and inevitable interoperability bugs that crop up with other add-ins.

  4. @Ian

    I’ve used and own ViEmu 🙂

    Unfortunately it’s not available for Visual Studio 2010 yet and I’m a bit of a Vim addict.  I started up this project in my spare time to compensate for the lack of ViEmu at work and home.  Given that ViEmu still isn’t available for Beta1, and that the source is a good demo on how to interact with the new editor API, I decided to release it to the public.  

    And yes, the current feature set of ViEmu trumps my hobby project in pretty much every area.  This is mainly a "for fun" project I used to get Vim back in Visual Studio 2010 and experiment with a non-trivial F# application.  

  5. jcoehoorn says:

    codeplex seems like the obvious choice for posting the code.

  6. @jcoehoorn

    Definitely agree.  But posting code publicly is almost never as simple as thinking about the most obvious choice 🙂

  7. Nemanja Trifunovic says:

    Very interesting! Thanks.

    Do you plan to implement insert-mode commands like Ctrl-P and Ctrl-N?

  8. subrat says:

    Could you please expand on your approach?

    Is it mainly just custom key event handlers?

  9. bybor says:

    Link you gave seems to be not working.

    This item is not yet published.

    If you are the owner of this project, please sign in with the appropriate account.

  10. @bybor,

    thanks for letting me know.  I just found out about this 2 days ago.  All Beta1 extensions were unpublished as soon as Visual Studio 2010 Beta2 went live.  I need to retarget my extension to Beta2 and republish the result.  I plan on doing so this weekend.  

  11. bybor says:

    @Jared Parsons,

    Would be great, thanks

  12. nekresh says:

    @subrat, after decompiling, this extension seems to be only using key handler, with differents states (normal, edit, command) written in F#

    @Jared Parsons, will you release the sources ? I’m interesting in reading and maybe contributing to it.

    I’ve decompiled it to read some parts of it, but Reflector doesn’t like F# for now and the result it pretty ugly (a raw translation to C#).

  13. @nekresh, I’ll be releasing the source this weekend when I update the package for Beta2.  I’ll put an announcement on this blog as to where to grab the source.

  14. Wanted to let everyone who is monitoring comments that I posted an updated version for Beta2.  Happy Vim`ing!

    http://blogs.msdn.com/jaredpar/archive/2009/11/16/vim-emulator-editor-for-beta2-released.aspx

  15. thinkhard says:

    consider hosting the project at github

  16. @thinkhard

    I actually do host this on GitHub as of a few days ago.  Right now it’s in a private depot though so it’s not visible.  I have to check on a few more things before I make it public.

    However it won’t be a truly public project though because i will not be able to take contributions from non-MS employees.  Not my decision, just the way of things right now.   But the source will be available for anyone to use.  

Skip to main content