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
Bootstrap 4 by Example
Intro to Font Awesome 5 (Free Course)
Pluralsight
Designing RESTful Web APIs (new)
Building an API with ASP.NET Web API
Building an API with ASP.NET Core
Building a Web App with ASP.NET Core, MVC6, EF Core, Bootstrap and Angular
Less: Getting Started

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