Visual Studio Tips and Tricks

Productivity Driven Development

10 Visual Studio Shortcuts You Must Know

| Comments

Most developers are familiar with using Ctrl + Space for intellisense, or Ctrl + Tab to cycle through open windows in Visual Studio. But Visual Studio is really keyboard friendly, and you have keyboard shortcuts for pretty much any functionality that is exposed via the various menus. You can configure them according to your preferences under Tools->Options->Environment->Keyboard. Here are 10 areas that you should definitely be familiar with:

  • Format Document
    Ctrl + K, Ctrl + D: Formats the current document

  • Collapse/Expand code
    Ctrl + M, Ctrl + M: Collapse/expand current element
    Ctrl + M, Ctrl + O: Collapse all
    Ctrl + M, Ctrl + L: Toggle all Outlining

  • Go to Definition
    F12: Go to definition of current code element

  • Smart Tag
    Ctrl + .: Open Smart Tag to allow adding missing namespaces or refactoring code.

  • Quick Launch
    Ctrl + Q: Focus in Quick Launch text box.

  • Clipboard ring
    Ctrl + Shift + V: Cycle through clipboard ring.

  • Navigate in code editor
    Ctrl + ]: Navigate to matching bracket
    Ctrl + –: Navigate to last cursor location
    Ctrl + Shift + –: Navigate forward to cursor location

  • Comment code
    Ctrl + K, Ctrl + C: Comments selected text
    Ctrl + K, Ctrl + U: Uncomments selected text

  • Bookmark
    Ctrl + K, Ctrl + K: Toggle Bookmark
    Ctrl + K, Ctrl + N: Go to Next Bookmark

  • Enter Full Screen
    Shift + Alt + Enter: View Code Editor in Full Screen

Use SqlSmash to write maintainable SQL scripts, understand code faster and navigate around easily in SSMS.

Comments