Some must-have keyboard shortcut for VS2012

Ctrl + X : Cut selected text.
Ctrl + X : Cut current line (if there is no selection).
Ctrl + L : Cut an entire line (no need to select the line, just place the cursor at any place on that line).

Ctrl + C : Copy selected text.
Ctrl + C :  Copy an entire line  (if nothing is selected).

Ctrl + V             : Simple paste.
Ctrl + Shift + V : Paste/cycle through the clipboard ring

Ctrl + Shift + L : Delete an entire line (no need to select the line, just place the cursor at any place on that line).

Ctrl + Shift + S : Save all modified open files.

Ctrl + Shift + F : Old-styled find dialog box.

Ctrl + I : Invoke search as you type.
Ctrl + F3  : Invoke search for the current selection.

After invoking Search, you can find instances as following way-

F3 : Case-insensitive forward searches for the next instance.
Ctrl + F3 : Case-sensitive forward searches for the next instance.
Shift + F3 : Case-insensitive backward searches for the previous instance.
Ctrl + Shift + F3 : Case-sensitive backward searches for the previous instance.

Esc  :   Quit search.

Working with cursor
Ctrl + –                : Move cursor to its previous location.
Ctrl +  Shift + –   : Move cursor to its next location (if any).
Ctrl + ]                : Will take you to the matching brace. Works with all kinds of braces: ‘(‘, ‘{‘, ‘[‘. Useful for big blocks.

Insert New Blank Line
Ctrl + Enter             : Insert blank line above cursor.
Ctrl + Shift + Enter : insert blank line below cursor.

Switches among open windows
Ctrl + tab             : Move forward
Ctrl + Shift + tab : Move backward.

Toggle Full screen mode
Shift + Alt + Enter

Ctrl  : Comment selected text/current line.
Ctrl U  : Uncomment selected text/current line.
Ctrl + EC  : Comment Selected Text
Ctrl + EU  : Uncomment Selected Text

Ctrl + Space : Invoke auto complete IntelliSense.
Ctrl               : When the IntelliSense drop down is displayed, holding down Ctrl turns the list semi-transparent so you can see what is hidden behind it.

Ctrl + Shift + ]                                    : Selects code between matching parentheses.
Alt + Shift + Arrow keys(,,,)   : Select texts in a vertical block.
Alt + Mouse drag                               :   Select texts in a vertical block.

Format Code
Ctrl + K + D : Format current document.
Ctrl + K + F : Format selection
Ctrl + E + F : Format selection

Ctrl + K + K : Toggle bookmark.
Ctrl + K + P : Go to previous bookmark
Ctrl + K + N : Go to next bookmark.
Ctrl + K + L : Clear all bookmarks.

Open Tool Window
Ctrl + Alt + L           : Solution explorer
Ctrl + Alt + S           : Server explorer
Ctrl + Alt + X           : Toolbox
Ctrl + Alt + O           : Output
Alt + P + P               : Open project properties
Ctrl + WE             : Show Error List
Ctrl + Shift + C        : Class view
Ctrl + W + J             : Show Object Browser
F4                             : Properties pane.
Alt + Enter               : Properties pane.
Ctrl + ,                      : Open  ‘Navigate To’ window

Close Window
Shift + Esc : Close currently focused tool window (i.e. Solution Explorer, Toolbox etc.)
Ctrl + F4     :  Close the current document window.


F5                     : Start debugging/Move to next breakpoint.
Shift + F5          : Stop debugging.
Ctrl   + F5          : Start Without Debugging.
F10                    : Step over next statement.
F11                    : Step into next statement.
Ctrl + F10          : Run to the cursor location.
F9                       : add or remove breakpoint.
Ctrl + Shift + F9 : Delete All Breakpoints

F6                      : Build Solution
Ctrl + Shift + B : Build Solution.
Shift + F6          : Build current project.

Scrolls the window without moving the cursor
Ctrl + Up Arrow
Ctrl + Down Arrow

Toggle Between Designer/Code view
F7 and Shift+F7 to switch between designer/code view

Show Syntax/Overloads
Ctrl + Shift +Space  : Shows the syntax/overloads for the current function you are typing parameters for.

Open a file without using the mouse
Ctrl + ,  : Open  ‘Navigate To’ window.
Ctrl + Alt + A : Opens command window, type >open YourFileName.cs

Collapse/Expand Code Block
Ctrl + M + M : Toggle expand/collapse the current code block.
Ctrl + M + L  : Toggle expand/collapsed all block of code.
Ctrl + MO : Collapse to definition.

Toggle WordWrap On/Off
Ctrl + E + W :

Wrap text in a tag
Ctrl + K + S :  It is great when you want to wrap some text in a tag.  i.e. place a code block in try..catch or #region…#endregion block.


You can customize any shortcut from Tools > Customize>Keyboard button, it gives you a list of commands you can search to see if a shortcut is available, or you can select the “Press Shortcut Keys:” textbox and test shortcut keys you want to assign to see if they conflict.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s