Friday, April 15, 2011

VS2010 Useful Shortcut

1. Manage Visual Studio
Ctrl+sSave current file
Ctrl+Shift+sSave all files
Ctrl+Shift+nCreate new project
Ctrl+oOpen file
Ctrl+Shift+oOpen project
Ctrl+Shift+aAdd item to project
EscClose menu or dialog
Shift+Alt+EnterToggle full screen mode
Ctrl+f4Close current tab
Ctrl+f6/Ctrl+Shift+f6Go to next / go to previous window
Ctrl+Tab, then Arrow keysPress and hold Ctrl+Tab, then using arrow keys gives a small task manager with all open files and views
▲ up
minus2. Bookmarks
For keystrokes with two keys such as Ctrl+k+k, keep holding the Ctrl key until releasing the last key.
Ctrl+k+kToogle bookmark
Ctrl+k+nGoto next bookmark
Ctrl+k+pGoto previous bookmark
Ctrl+Shift+k+nGoto next bookmark in folder
Ctrl+Shift+k+pGoto previous bookmark in folder
Ctrl+k+wPut focus on bookmark window
EscLeave bookmark window and focus on editor
Ctrl+k+hToggle code shortcut at current line*
Ctrl + K + LClear all bookmarks
*if somebody figures out additional shortut keys on how to use code shortcuts, please edit this page and add.
▲ up
minus3. Code Editor
minusFind, Replace, and Goto
Ctrl+fFind and replace dialog box
f3/Shift+f3Find next / find previous
Ctrl+hDisplay Replace options on the quick tab
Shift+f12Find all references for selected symbol
Ctrl+Shift+fFind in files
Alt+F3, sStop current find in files operation
Ctrl+F3/Ctrl+Shift+f3Find next / find previous in selected text
Alt+F12Find symbol
Ctrl+dPut cursor in find/command box of the toolbar. Use ctrl+/ in Visual C#
Ctrl+i/Ctrl+Shift+iIncremental search / reverse incremental search
Shift+Alt+f12Quick find symbol
Ctrl+,Display Navigate-To dialog box
Ctrl+gGoto line number
Ctrl+]Go to matching brace in source file
minusUndo, Redo, Copy, Paste
Ctrl+x, Ctrl+x, Ctrl+vCut, copy, paste
Ctrl+Shift+vPastes an item from the Clipboard ring
Ctrl+yRedo (or Shift+Alt+Backspace, or Ctrl+Shift+Z)
minusSelect Text
Shift+Arrow KeysExtend selection one character/one line
Ctrl+Shift+End/ Ctrl+Shift+HomeExtend selection to end / to beginning of document
Ctrl+Shift+]Extend selection to nexst brace
Shift+End/ Shift+HomeExtend selection to end / to beginning of line
Shift+Page Down/ Shift+Page UpExtends selection down one page / up one page
Ctrl+wSelect current word
EscCancel Selection
Ctrl+Shift+Page Down/ Page UpMoves cursor and extend selection to the last line / first line in view.
Ctrl+Shift+Arrow right/ arrow leftExtend selection one word to the right / one word to the left
Ctrl+aSelect All
▲ up
minus4. Coding
minusCollapse Items
Ctrl+m+mCollapse / un-collapse current preset area (e.g. method)
Ctrl+m+hCollpase / hide current selection
Ctrl+m+oCollapse declaration bodies
Ctrl+m+aCollapse all
Ctrl+m+xUncollapse all
Ctrl+m, ctrl+tCollapse Html tag
minusEdit Code
Ctrl+lDelete current line or selection of lines to and add to clipboard
Ctrl+Shift+lDelete current line or selection of lines
Ctrl+DeleteDelete word to right of cursor
Ctrl+BackspaceDelete word to left of cursor
Ctrl+EnterEnter blank line above cursor
Ctrl+Shift+EnterEnter blank line below cursor
Ctrl+Shift+uMake uppercase
Ctrl+uMake lowercase (reverse upercase)
Ctrl+k+cComment selected text
Ctrl+k+uUncomment selected text
Ctrl+k+\Remove white space and tabs in selection or around current cursor position
Ctrl+k+dFormat document to code formatting settings
Ctrl+k+fFormat selection to code formatting settings
Ctrl+Shift+spaceDisplay parameter required for selected method
Ctrl+Shift+8Visualize whitespace (or press Ctrl+r, then Ctrl+w)
Ctrl+k+dFormat document to code formatting settings
Ctrl+k+fFormat selection to code formatting settings
Ctrl+Shift+tTranspose word to right of cursor; makes b=a out of a=b if cursor was in front of a
Ctrl+tTranspose character left and right of cursor; cursor between ab would make ba
Shift+Alt+tTranspose line: Move line below cursor up and current line down.
minusIntelliSense and Code Helper
Ctrl+SpaceAutocomplete word from completion list (or alt+right arrow)
Ctrl+Shift+SpaceShow parameter info
Ctrl+f12Display symbol definition
f12Display symbol declaration
Ctrl+jOpen IntelliSense completion list
▲ up
minus5. Build and Debug
f7Build solution (or Ctrl+shift+b)
Ctrl+Alt+f7Rebuild solution
Ctrl+breakCancel build process
Ctrl+\+eShow error list
f9Toggle breakpoint
Ctrl+bInsert new function breakpoint
f5Start debugging
f11Debug / step into
f10Debug / step over
Shift+f11Debug / step out
Ctrl+f10Debug / run to cursor
Ctrl+Alt+qShow Quickwatch window
Ctrl+Shift+f10Set current statement to be the next executed
Alt+* (on numeric keyboard)Show nexst statement
Ctrl+Alt+eShow Exception dialog box
Ctrl+f11Toggle between disassembly and user code view
Shift+f5Stop Debugging
Ctrl+f5Bypass debugger
Ctrl+Alt+pShow attach to process window
Ctrl+Alt+breakBreak all executing threads
▲ up
minus6. Tool Windows
Ctrl+/Put cursor in the find/command box in toolbar
Ctrl+k+bOpen code snippet manager window
Alt+f11Open macro IDE window
Ctrl+k+wOpen bookmark window
Ctrl+Alt+kOpen call hierarchy window
Ctrl+Shift+cOpen class view window
Ctrl+Alt+aOpen Command window
Ctrl+Shift+oOpen Output window
Ctrl+Shift+eOpen Resource view window
Ctrl+Alt+sOpen Server explorer window
Ctrl+Shift+lOpen Solution explorer window
Shift+EscClose Find & Replace Window