Visual Studio 2008 and Emacs

I’m starting to use Visual Studio after years of disuse. It’s amazing to see all the improvements that have gone into Visual Studio since version 5! As a programmer who prefers working in a terminal window (I like the dark colors), being impressed by a GUI is something significant–especially since I’ve gotten used to using Emacs!

Yes, it’s true. I am a die-hard emacs fan. When an editor does not have emacs emulation (or faulty emulation like Komodo), I’ll do what I can to return to my great love: the terminal.

After installing Visual Studio 2008, I was pleasantly surprised. There is an Emacs emulation mode in Visual Studio 2008!

Tools > Options… > Environment > Keyboard

Under “Apply the following additional keyboard mapping scheme,” select “Emacs.” Hit OK and done!

I tried the kill ring (C-k and C-y), and it worked as I would expect in Emacs. Very cool. They were pretty ingenious with the mark region too (C-<space>). It begins highlighting of text in the editor.

Almost immediately, though, I found a problem. The tab key no longer works on new lines. The proper functionality would be new lines indenting to the appropriate place based on previous context. But no, it only works on lines with current text. Pressing <return> does not indent automatically! What were they thinking?

Deal breaker for me.

3 comments to Visual Studio 2008 and Emacs

  • Thank you Matthew. Your solution worked for the source editor. I’m still having problems in the HTML/text editors though. It won’t allow me to assign the tab key to anything. I’ve ended up using emacs emulation and adding lots of spaces in HTML.

  • Jack

    Matthew’s solution worked perfectly for me. Thanks!

  • Matthew

    I just stumbled across this while googling for the same problem. You should have googled a bit longer :) Anyway, you can fix it by going to Tools->Options->Environment->Keyboard (this is in VS2005, but I think it’s the same). Under “Show commands containing”, type “breakline”. Click on Edit.Breakline, then under “Use new shortcut in:”, choose Text Editor. Click or tab to the next box, hit the Enter key, then click Assign.

Leave a Reply