I was born in Bulgaria. My immediate family and I relocated to Syracuse, NY in 1995. I completed high school in Syracuse, and then continued my education at Alfred University. My major at Alfred University was Computer Science. I also obtained a minor in Management Information Systems (MIS) to bridge the gap between technology and the business world. One of my future goals is to extend that bridge by obtaining a Master's degree in Business Administration. Boyan is a DZone MVB and is not an employee of DZone and has posted 27 posts at DZone. You can read more from them at their website. View Full User Profile

Top 13 Visual Studio Keyboard Shortcuts

03.04.2008
| 81987 views |
  • submit to reddit

My friends in college always made fun of my keyboard obsession. At the time, I knew all the Windows 98 specific shortcut keys and often had no need for the mouse. Keyboard shortcuts still rule in my book. It is amazing that you can get around without using a mouse at all. Master the following Visual Studio shortcuts and your colleagues might stare at you with amazement.

  1. F5: Start your project in debug mode

    vsShortcutsNumber1
  2. F7 & Shift-F7: Show the code windows & Show the designer window

    vsShortcutsNumber2
  3. Alt-Enter: Show the properties panel for a selected object (this is general Windows shortcut that can be used on files and directories)

    vsShortcutsNumber3
  4. F6 / Shift-F6 / Ctrl-Shift-B: Build solution / Build project / Build solution

    vsShortcutsNumber4 
  5. Shift-Alt-C: Add a new class to your project

    vsShortcutsNumber12 
  6. Ctrl-K + Ctrl-C: Comment a selected block of code

    vsShortcutsNumber5
  7. Ctrl-K + Ctrl-U: Un-comment a selected block of code

    vsShortcutsNumber6
  8. Ctrl-M + Ctrl-O / Ctrl-M + Ctrl-P: Collapse all code to definitions / Expand all code (stop collapsing)

    vsShortcutsNumber7
  9. Ctrl-M + Ctrl+M: Expend or collapse a selected code fragment. The code collapsed depends on where the cursor is located

    vsShortcutsNumber8
  10. Ctrl-B + Ctrl-T: Toggle code bookmark

    vsShortcutsNumber9
  11. Ctrl-Alt-P: Attach the debugger to a process. This is insanely useful for debugging ASP.NET web sites without having to start the project in debug mode

    vsShortcutsNumber10
  12. Ctrl-Alt-L: Show the solution explorer

    vsShortcutsNumber11 
  13. Ctrl-Shift-A / Alt-Shift-A: Add a new item to your project / add an existing item to your project

    vsShortcutsNumber13

The above list is my top 13. Did I miss any essential ones? What are yours?

Bonus:

The following work in Visual Studio just like they do in most other Windows application.

Ctrl-N: Add a new file

Ctrl-S: Save file

Ctrl-Z / Ctrl-Y: Undo typing / Redo typing

Ctrl-F: Bring up the "Find" dialog

Ctrl-H: Bring up the "Replace" dialog

Ctrl-Tab: Scroll forward through open windows

Ctrl-Shift-Tab: Scroll backwards through open windows

References
Published at DZone with permission of Boyan Kostadinov, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Ajya Chang replied on Sat, 2012/02/18 - 6:50am

Hello,

Thanks for putting up some basic shortcuts.

They can be very useful from developer's point of view. I think you should also include the debugginf short cut keys as they are more used by developers. But this will be of great help. Once again thanks for the information. Keep it up.

 Thanks

Kookee Gacho replied on Sat, 2012/06/09 - 11:55pm

Visual Studio, like any other IDE, includes a code editor that supports syntax highlighting and code completion using IntelliSense for not only variables, functions and methods but also language constructs like loops and queries.-  Marla Ahlgrimm

Pavel Vladov replied on Tue, 2012/12/11 - 8:34am

Nice article, but there are some more very useful Visual Studio keyboard shortcuts one can use to boost his productivity. If you are interested, I've recently created a list of The Most Useful Visual Studio Keyboard Shortcuts.

Pavel Vladov replied on Tue, 2012/12/11 - 8:34am

Nice article, but there are some more very useful Visual Studio keyboard shortcuts one can use to boost his productivity. If you are interested, I've recently created a list of The Most Useful Visual Studio Keyboard Shortcuts.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.