Hi, I'm Jason Nguyen. I author this blog, develop software, and am a Microsoft Certified Professional.

Visual Studio Shortcut: Surround With

Surround With: Ctrl + K, Ctrl + S

This Visual Studio shortcut is awesome! Use it to encapsulate an existing block of code; it has options for using, if/else, try/catch, loops, and more.

How to use:

  1. Enter the Visual Studio shortcut command
  2. Choose the construct by typing the name or pressing the up/down arrows
  3. Hit Enter
  4. The code is inserted similar to using a code snippet
  5. If more than one input, use Tab to navigate them
  6. Use Enter to complete the snippet
Surround with an if/else statement

Surround with an if/else statement

 
Surround with a try/catch statement

Surround with a try/catch statement

Visual Studio Shortcut: Move Selected Lines

Visual Studio Shortcut: Comment Selection, Uncomment Selection