Partager via


Visual Studio 2005 Tips #2 - Keyboard Shortcuts

Want to be more efficient when using Visual Studio Development Tool?
Here are some commonly used keyboard shortcuts during development.

Debugging Shortcut Keys, General Development Settings 
1. Debug.Start (F5)
    Automatically attaches the debugger and runs the application from the startup project specified in the <Project> Properties dialog box. Changes to Continue if in Break mode.

2. Debug.StartWithoutDebugging (CTRL + F5)
    Runs the code without invoking the debugger.

3. Debug.StepInto (F11)
    Executes code one statement at a time, following execution into function calls.

4. Debug.StepOut (Alt + F11)
    Executes the remaining lines of a function in which the current execution point lies.

5. Debug.StepOver (F10)
    Executes the next line of code, but does not follow execution through any function calls.

6. Debug.StopDebugging (SHIFT + F5)
    Stops running the current application in the program. Available in Break and Run modes.

7. Debug.Breakpoints (CTRL + ALT + B)
     Displays the Breakpoints dialog box, where you can add and modify breakpoints.

8. Debug.DeleteAllBreakpoints (CTRL + SHIFT + F9)
    Clears all of the breakpoints in the project.

Window Management Shortcut Keys, General Development Settings 

1. FullScreen (SHIFT + ALT + ENTER)
    Toggles Full Screen mode on and off.

2. View.NavigateBackward (CTRL + -)
    Moves back to the document or window next in the navigation history.

3. View.NavigateForward (CTRL + SHIFT + -)
    Moves forward to the document or window next in the navigation history.

4. Window.CloseDocumentWindow (CTRL + F4)
    Closes the current MDI child window.

5. Window.CloseToolWindow (SHIFT + ESC)
   Closes the current tool window.

Project Shortcut Keys, General Development Settings 

1. Build.BuildSolution (CTRL + SHIFT + B)
    Builds the solution.

2. Build.Cancel (CTRL + BREAK)
   Stops the current build.
 
3. Build.Compile (CTRL + F7)
   Creates an object file containing machine code, linker directives, sections, external references, and function/data names for the selected file.

4. File.NewFile (CTRL + N)
    Displays the New File dialog box where you can select a new file to add to the current project.
 
5. File.NewProject (CTRL + SHIFT + N)
    Displays the New Project dialog box.
 
6. File.OpenFile(CTRL + O)
    Diplays the Open File dialog box.
 
7. File.OpenProject (CTRL + SHIFT + O)
    Displays the Open Project dialog box where you can add existing projects to your solution.

8. Project.AddExistingItem (SHIFT + ALT + A)
    Displays the Add Existing Item dialog box, which allows you to add an existing file to the current project.
 
9. Project.AddNewItem (CTRL + SHIFT + A)
    Displays the Add New Item dialog box, which allows you to add a new file to the current project.
 
10. Project.Override (CTRL + ALT + INSERT)
     Allows you to override base class methods in a derived class. Available for C#.
 
Code Snippet Shortcut Keys, General Development Settings 

1. Edit.InsertSnippet (CTRL + K, CTRL + X)
   Displays the Code Snippet Picker, which allows you to select a snippet using IntelliSense and then inserts the code snippet at the cursor position.
 
2. Edit.SurroundWith (CTRL + K, CTRL + S)
    Displays the Code Snippet Picker, which allows you to select a snippet using IntelliSense and then wraps the snippet around the selected text.
 
3. Tools.CodeSnippetsManager (CTRL + K, CTRL + B)
    Displays the Code Snippets Manager, which allows you to search for and insert code snippets into files.

Comments

  • Anonymous
    December 10, 2006
    I can never find the shortcut for switching back and forth between a window that is split (with that thing right above the vertical scrollbar).

  • Anonymous
    December 11, 2006
    You mean moves to the next pane of a split pane view of a single document? Try use F6 and SHIFT +F6 goes back to the previous pane

  • Anonymous
    January 22, 2008
    any ideas if there's a shortcut key to move up and down the split window in 2005 or 2008? check out isqlw, it used CTRL+B and you could move it up and down without reaching for the mouse.

  • Anonymous
    April 09, 2008
    if we set Keyboard mapping scheme to (default) in keyboard options from Tools menu, F6 and Shift+F6 works fine for switching back and forth between a window that is split (with that thing right above the vertical scrollbar).

  • Anonymous
    May 27, 2010
    Does anyone know how to add an existing item without stopping debug? I have been told this can be done by pausing debug. Then the option would become available by right clicking, but I stilll have to stop or visual studio would not allow me to edit at all unless I stop debug and start over.