36

How can I get Emacs style key bindings in Visual Studio? Is it available in Settings? Do I need a Plug-in?

Alex B
  • 24,678
  • 14
  • 64
  • 87
Ray
  • 187,153
  • 97
  • 222
  • 204

10 Answers10

25

You can try the Emacs keyboard scheme (Tools->Options->Environment->Keyboard)

jfs
  • 16,758
  • 13
  • 62
  • 88
  • 2
    Note that you need Visual Studio 2005 and later for that. – JesperE Oct 10 '08 at 07:53
  • It's available in the C# 2008 Express edition, at least as of 1 Mar 2010. – BryCoBat Mar 01 '10 at 16:24
  • 8
    Seems like VS 2010 no longer supports Emacs key bindings: http://connect.microsoft.com/VisualStudio/feedback/details/465750/emacs-keyboard-mapping-scheme-not-working-in-visual-studio-2010-beta-1 – Ray Jun 08 '10 at 21:18
  • 12
    Now VS2010 does with an add-in: http://blogs.msdn.com/b/visualstudio/archive/2010/09/01/emacs-emulation-extension-now-available.aspx – Ray Sep 13 '10 at 05:07
  • This works as of VS2019. – Vasantha Ganesh Oct 27 '21 at 13:00
12

Xkeymacs does a really good job of this. It is possible to configure this tool for every application running on your desktop.

Ray
  • 187,153
  • 97
  • 222
  • 204
Torleif
  • 2,334
  • 3
  • 27
  • 28
  • 1
    I used Xkeymacs for a few weeks, but found I was having weird problems with the keyboard commands being trapped. I stopped using Xkeymacs and the issues went away... It was great, while it lasted... – Michael Paulukonis Nov 17 '10 at 17:01
  • Thanks for this suggestion. I was having the problem of my CTRL+v et al. being captured like @MichaelPaulukonis was. I fixed it by going into the Xkeymacs properties and setting the "default" to "Disable XKeymacs" and only enabling it for the applications I wanted (like visual studio, notepad, SAS, etc.). Additionally, if you just want copy-paste to work, you can uncheck the C-v keybinding and it will then pass that command through to the underlying app, which executes a paste. – Matt Klein Sep 30 '13 at 18:08
5

With Settings:

Try the Emacs keyboard scheme on Environment options.

Plugins:

I have only seen this one: VisEmacs, it will integrate Emacs as the default text editor for Visual Studio.

Christian C. Salvadó
  • 807,428
  • 183
  • 922
  • 838
5

After posting that Emacs keybindings/emulation would no longer be available in Visual Studio 2010, Emacs Emulation is now available as a free extension for VS 2010.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Ray
  • 187,153
  • 97
  • 222
  • 204
4

For VS2019 it is an extension written by the community.

(Installing the extension)

  1. Open Visual Studio 2019
  2. Click Extensions -> Manage Extensions
  3. Select "Online" in the left-side panel.
  4. In the search box, enter "emacs"
  5. As of March 2020, "Emacs Emulation 2" seems to be the thing. Select it and click "Download"
  6. Close the window and close all open copies of Visual Studio. VSIX Installer will install the plug-in with your permission.

(Turning on EMACS)

  1. Open Visual Studio
  2. Use the menu Tools -> Customize. Click the "Keyboard" button at the bottom.
  3. In the box at the top there will be an EMACS scheme that wasn't there before. Pick it. Click OK.
  4. Close and reopen any code/text editing windows.

Press Ctrl-A, Ctrl-E, Ctrl-F.. It feels like a warm blanket on a cold day.

user922020
  • 712
  • 6
  • 12
3

I use VisEmacs because the emacs keyboard scheme isn't quite as nice as emacs itself.

Alex B
  • 24,678
  • 14
  • 64
  • 87
2

Unfortunately, the Emacs emulation extension for VS 2010 is not officially supported for VS 2012.

However, a workaround is possible if follow the steps outlined in this answer for an SO question on getting Emacs key-bindings in VS2012

Community
  • 1
  • 1
Ray
  • 187,153
  • 97
  • 222
  • 204
1

If you're using Visual Studio Express 2008 and want the Emacs key bindings then you need to install the Visual C++ edition of VSE 2008. Initially I only installed the C# edition and there were no custom key bindings in Tools->Options->Environment->Keyboard. Once I installed the C++ edition the Emacs key bindings became available in both products.

jgibson
  • 1,013
  • 11
  • 9
1

I used the Emacs keyboard scheme for a few days, but it quickly drove me crazy -- I couldn't rebind keys they way I was used to in Emacs (or couldn't find how to rebind quickly).

I should try XKeyMacs....

Michael Paulukonis
  • 9,020
  • 5
  • 48
  • 68
0

A quick Live search for "visual studio emacs" gave this page. I'm not sure how thorough it is though (having never used emacs myself).

Jimmy
  • 27,142
  • 5
  • 87
  • 100