Visual Studio and Emacs… at the Same Time!

Posted on June 9, 2008
Filed Under Computer Science |

Or, I Finally RTFM, and saw that it was good.

If you’re like me, you started using Microsoft’s compiler when you started to learn to program. I don’t consider this a loss: Visual C++ has a very good debugger, and code completion is always helpful. What was a loss was learning to program C++ on Visual C++ 6.0 and spending the first part of college re-learning C++, but that is another rant for another day.

In my development environment, Windows was replaced by Unix, and my editor switched to Nano. I had heard about the Great Vim/Emacs Debate , and eventually sunk my teeth into Vim. I used Vim for about a year and a half, and recently started trying out Emacs, just to see what it had to offer. I liked its development paradigm enough that within a month, I never looked back at Vim, except to make some of the Emacs key bindings more Vim-like.

I then found that I was going to be using Visual Studio extensively in the future. Again, Visual Studio has quite a lot to offer, but it just isn’t Emacs. I decide that I’m going to customize Emacs to be compatible with Visual Studio (or, as much as possible), but I find providence: Visual Studio has Emacs key bindings!

How Do I Enable Them???

In Visual Studio 2005,

In all of its glory!

Click to see full size.

What Works?

So far, it looks like it includes a good portion of the Emacs functionality. Things that I have found that works correctly:

What Doesn’t Work?

One of the first things I tried to do was type M-x compile, and it was a no-go.

What M-x DOES do is perform Visual Studio actions, such as Action.AddDialog . I’ve never used Visual Studio actions, but just in case you find them useful, there you go! Some of the Emacs actions are there. If you go to the place where you enabled the key bindings, you can search for ones containing "Emacs"

It also looks like tabbing doesn’t work correctly . If you start a new line, it won’t tab you to the spot you want. C-j gives me the behavior I want, but I’m not sure I’m willing to forego such a basic editing requirement. It looks like I can bind commands to any key combination BUT <Tab> (pressing <TAB> for a key binding moves to the next selection box. Ugh.), so I have no idea if this is fixable. If not, I’d consider this a dealbreaker.

Popularity: 18% [?]

Comments

Leave a Reply