My Favorite Visual Studio Shortcuts and Snippets


Keyboard Shortcuts

I've been speaking at user groups and conferences for a long time now. Usually at these short talks I don't get asked much about how I use Visual Studio.  But now that I am teaching Silverlight, my students are never shy about asking what I am doing while in Visual Studio.  I am often amazed by how people use Visual Studio without learning some of my favorite hotkeys/snippets.  Here are some of mine:

Keyboard ShortCuts

  • Ctrl-Shift-B: Build Solution
  • Ctrl-. (period): Show "Add Using/Imports" dropdown for unknown types.
  • Ctrl-K, C: Comment Selection
  • Ctrl-K, U: Uncomment Selection
  • Ctrl-K, F: Format Section
  • Ctrl-K, D: Format Document
  • Ctrl-Space: Show Intellisense List
  • Ctrl-Shift-V: Paste Loop - Hit Multiple Times to paste through the list of recent 'copies'
  • Ctrl-F: Simple Find
  • Ctrl-Shift-F: Find in Files
  • Ctrl-H: Simple Replace
  • Ctrl-Shift-H: Replace in Files
  • Ctrl-N: New->Project Item
  • Ctrl-Shift-N; New Project
  • F9: Set Breakpoint
  • Ctrl-Shift-R: Start/End Temporary Macro Recording
  • Ctrl-Shift-P: Play Temporary Macro Recording
  • F12; Navigate to Type (or metadata for Type) under the cursor

Snippets

(To use these snippets, type the phrase and hit Tab twice)

  • prop: Create a simple property in a class
  • propg: Create a simple property with a public get and a private set
  • foreach: Create a foreach block
  • sldpc: Create a Silverlight Dependency Property*

* This snippet is from the Silverlight Contrib snippet collection.

What are yours?



Shawn
Shawn Wildermuth
Author, Teacher, and Coach




My Courses

Wilder Minds Training
Vue.js by Example (New Lower Price)
Bootstrap 4 by Example (New Lower Price)
Intro to Font Awesome 5 (Free Course)
Pluralsight
Building an API with ASP.NET Core (New Course)
Building a Web App with ASP.NET Core, MVC6, EF Core, Bootstrap and Angular (updated for 2.2)
Less: Getting Started (New)
Using Visual Studio Code for ASP.NET Core Projects
Implementing ASP.NET Web API

Application Name WilderBlog Environment Name Production
Application Ver v4.0.30319 Runtime Framework x86
App Path D:\home\site\wwwroot\ Runtime Version .NET Core 4.6.27817.01
Operating System Microsoft Windows 10.0.14393 Runtime Arch X86