The official source of product insight from the Visual Studio Engineering Team
We are pleased to announce the availability of Emacs Emulation as a free extension for Visual Studio 2010! This extension provides basic support for Emacs keybindings and text editing commands, very similar to the built-in Emacs keyboard layout in VS 2008. Once the extension is installed you should be able to use familiar keyboard shortcuts to execute Emacs commands within VS 2010.
Installing Emacs Emulation requires Visual Studio 2010 Pro, Premium, or Ultimate (the Express editions do not support extensions) and a one-time elevation to administrator permissions. This elevation is necessary to install the keybindings file in the Visual Studio Program Folder. The first time you launch Visual Studio after downloading and installing the extension, you should see a permissions dialog, shown below. Click OK and follow the system prompt to elevate. This is only required once; subsequent launches of Visual Studio will not prompt for elevation.
After installing the extension and keybindings file, go to Tools->Options->Keyboard to select the Emacs keyboard mapping scheme, as shown below:
You can begin using Emacs shortcuts as soon as you’ve selected Emacs as your keyboard mapping scheme. Some of the most common Emacs shortcuts supported by this extension are:
General Shortcut Keys
ALT + X
Places the cursor in the Find/Command box on the Standard toolbar.
SHIFT + ALT + 5
Displays the replace options in the Quick tab of the Find and Replace dialog box.
ALT + Y
Pastes an item from the Clipboard Ring tab of the Toolbox to the file and automatically selects the pasted item. Press ALT + Y again to paste the next item to the Clipboard Ring.
CTRL + G
Stops the current command or code and deactivates the region.
CTRL + U
Prompts for an integer, returns negative if the first character entered is a hyphen. When a non-digit character is entered, the prefix for the command is set to the entered integer. If no integer is entered, the default value is 4. Repeatedly invoking the command multiplies the current value entered by the previous accumulated value.
Inserts a new line.
CTRL + J
Inserts a new line and indents it.
CTRL + T
Transposes the characters on either side of the cursor. For example, Ed|n Sub would be changed to read End| Sub.
CTRL + DELETE
Deletes the current selection.
CTRL + K
Deletes from the cursor to the end of the current line.
CTRL + O
Inserts a new line after the cursor. The cursor stays in the current line.
CTRL + Q
Reads another key and inserts the key into the buffer. Keys must be 8-bit ASCII characters. Use this command to insert control characters, meta characters, or graphics characters into the buffer.
ALT + C
Capitalizes the character to the right of the cursor or the first character of the next word if the cursor is between words.
ALT + D
Deletes the characters to the right of the cursor to the end of the word.
ALT + BACKSPACE —or— ALT + DELETE
Deletes the characters from the left of the cursor to the start of the word.
ALT + L
Changes the selected text to lowercase characters.
ALT + T
Transposes the words on either side of the cursor. For example, |End Sub would be changed to read Sub End|.
ALT + U
Changes the selected text to uppercase characters.
CTRL + B
Moves the cursor one character to the left.
CTRL + F
Moves the cursor one character to the right.
END —or— SHIFT + ALT + . (period) —or— SHIFT + END —or— CTRL + X, ]
Moves the cursor to the bottom of the current document.
HOME —or— SHIFT + ALT + , (comma) —or— SHIFT + HOME —or— CTRL + X, [
Moves the cursor to the top of the current document.
ALT + G
Displays the Go To Line dialog box, which allows you to navigate to a specific line of code in the current document.
CTRL + N
Moves the cursor down one line.
CTRL + E
Moves the cursor to the end of the current line. If you use word wrap, the cursor moves to the physical, not the displayed, end of the current line.
CTRL + A
Moves the cursor to the beginning of the current line. If you use word wrap, the cursor moves to the physical, not the displayed, beginning of the current line.
CTRL + P
Moves the cursor up one line.
CTRL + X, CTRL + SPACEBAR —or— CTRL + X, CTRL + SHIFT + 2
Moves the cursor to the current mark and then removes the mark for the location stack.
CTRL + L
Scrolls the document so that the current line is now in the center of the viewable area in the editor.
SHIFT + ALT + 1
Scrolls the document so that the current line appears at the top of the viewable area in the editor.
CTRL + V
Scrolls down within the document.
ALT + V
Scrolls up within the document.
CTRL + SHIFT + 2 —or— CTRL + SPACEBAR
Adds a mark to the location stack for the current cursor.
CTRL + X, CTRL + X
Moves the cursor to the current mark in the location stack and moves the current mark to the location where the cursor mark was when the command was invoked.
CTRL + RIGHT ARROW —or— ALT + F —or— ALT + RIGHT ARROW
Moves the cursor to the first character in the next word.
CTRL + LEFT ARROW —or— ALT + B —or— ALT + LEFT ARROW
Moves the cursor to the first character in the previous word.
CTRL + X, S
Displays a list of modified files and allows you to select which files to save.
CTRL + X, 1
When a window is split, this shortcut closes the pane that does not have focus.
CTRL + X, O
Switches focus between panes when a window is split.
CTRL + X, 2
Splits the current document in half vertically. The current line of code is centered in each window.
Once you’ve installed the Emacs Emulations extension, all of the Emacs shortcuts it enables are fully customizable. If you choose to use the Emacs keyboard schema, you’ll automatically get the shortcuts listed above. If you don’t like a particular keybinding in the Emacs schema, you can always change it through Tools->Options->Keyboard. You can switch keyboard layouts or customize shortcuts for specific commands (Emacs or otherwise) at any time.
We’re always interested in your feedback on Visual Studio and extensions published by Microsoft. In fact, this extension was created largely in response to your feedback that removing Emacs emulation from VS 2010 was causing significant pain on a daily basis; we hope we’ve addressed that pain with this extension. If you have questions or comments about Emacs Emulation, feel free to post them in the blog comments here. If you find a specific bug in the Emacs Emulation extension, please file a Connect bug report so we can investigate in more detail.
Brittany Behrens Program Manager, Visual Studio Editor