Visual Studio – shortcuts

My favourite (or the most often used) shortcuts in Visual Studio 2015:

Editing:

Ctrl+X – cut the line (you don’t need to select the text in line, just put the cursor).

Ctrl+C – copy the line (see above).

Ctrl+V – paste the line (see above).

Ctrl+Shift+L – delete the line (see above).

Ctrl+Shift+V(multiplied) – show clipboard history.

Ctrl+, – search for classes, methods and so on.

Ctrl+F – find next.

Ctrl+Shift+F – find all.

Ctrl+-/Ctrl+Shift+- – go to previous/next place when you edited the code.

Alt+Down/Up – move code up or down.

Ctrl+K+D – format the code.

Ctrl+K+F – format the selected code.

Ctrl+] – go to closing “}” or opening “{” bracket (use when cursor is next to opening or closing bracket).

Ctrl+G – go to line number.

Ctrl+K+C – comment selected text.

Ctrl+K+U – uncomment selected text.

Ctrl+Shift+W – select current word.

Shift+Alt+. – select next occurence of selected word

Ctrl+S – save file.

Ctrl+Shift+S – save all files.

Ctrl+R,R – rename.

Ctrl+Enter – put new line above cursor.

Shift+Enter – put new line below cursor.

Ctrl+Alt+Click+Click+… – allow editing in multiple places at the same time

Snippets:

propfull+tab+tab – insert snippet for property with backing field.

propdp+tab+tab – insert snippet for dependency property.

Debugging:

F10 – step out.

F11 – step in.

F5 – run.

F9 – add/remove breakpoint.

Windows:

Alt+F7 – move along windows.

Ctrl+Tab – move along active files.

Ctrl+Shift+Alt+Up – members list.

Alt+F12 – peek definition; when your cursor is on a method call, new window with body of this method is displayed and you can edit it here.

Ctrl+Alt+I – Immediate window.

Ctlr+Alt+O – Output window.

Ctrl+Alt+P – attach to process.

Ctrl+Alt+A – commands window.

F4 – properties window.

Ctrl+Alt+L – Solution explorer window.

Shift+F10 – context menu.

Others:

Ctrl+F4 – close document window.

Ctrl+T+R – shows recently opened files

Ctrl+K,K – add/remove bookmark.

Ctrl+K,N – go to next bookmark.

Ctrl+K,P – go to previous bookmark.

F6 – build solution.

F12 – go to (method) definition.

Ctrl+F12 – go to declaration.

Ctrl+Shift+Backspace – go to last edited code

Ctrl+- – go to last cursor position

Ctrl +R,T – debug unit test (works when your cursor is in unit test method body)

Of course there are much more shortcuts defined in Visual Studio: http://visualstudioshortcuts.com/2015/

Leave a comment