Visual Studio Tips and Tricks

Visual-Studio-2012-Banner

The boot camp team had the pleasure of learning a few visual studio tips and tricks from Improving’s Latish Sehgal today, and I thought I’d share his information and my notes from the talk for reference.

If you want to see more of Latish’s tips, visit his blog!


Visual Studio Shortcuts You Must Know: (See More)

  • Ctrl + Q
    • Quick Launch
  • Ctrl + ;
    • Solution Search
  • Ctrl + ,
    • Navigate To (search)
  • Ctrl + K, Ctrl + D
    • Formats the current document
  • Alt + Shift + Enter OR Shift + Alt + Enter
    • Makes VS go full screen.
  • Alt + Windows + 3
    • Same as right click VS button to open a specific project.
  • Ctrl + Space OR Ctrl + .
    • Intellisense
  • Ctrl + Tab
    • Cycle through open tabs/windows in Visual Studio
  • Alt + Up/Down Arrows
    • Move selected lines of code (or line where your cursor is) up or down one line.
  • Alt + Mouse Drag
    • Allows you to select a vertical column of text and enables you to replace all at the same time.
  • Ctrl + Alt + Arrows
    • Change orientation of your screen.
  • Ctrl + Shift + F
    • Find All
  • Ctrl + Shift + V
    • Cycle through clipboard ring
  • Ctrl + K + C
    • Comment selected code
  • Ctrl + K + U
    • Uncomment selected code
  • Ctrl + M + O
    • Collapse
  • Shift + f7
    • Visual Mode?
  • Fn + Alt + f12
    • Allows you to look into the declaration of a class or property and edit it without opening a new file. Can f12 into multiple files and see breadcrumbs in the small edit window
  • F12
    • Go to Definition of current code element
  • Ctrl + –
    • go back after f12 into a class/prop/method/etc.

 

Visual Studio Extensions


Web Essentials 2012

http://visualstudiogallery.msdn.microsoft.com/07d54d12-7133-4e15-becb-6f451ea3bea6

Web Essentials 2013 for Update 2 (Web Devs NEED THIS) allows you to edit html/css in the browser. You need VS Update 2 before you install the Web Essentials 2013 update (check your visual studio updates). Web Essentials has support for CSS, SASS, and LESS – extracting variables

http://visualstudiogallery.msdn.microsoft.com/56633663-6799-41d7-9df7-0f2a504ca361

Productivity Power Tools

http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/

Code Lense – References and Tests (that’s what the #references are)

http://visualstudiogallery.msdn.microsoft.com/f85a7ab9-b4c2-436c-a6e5-0f06e0bac16d

NCrunch – NUnit test coverage visual aides. Auto runs tests when you’re modifying them or the related code

http://www.ncrunch.net/

VSVim – using different arrow keys by using some letter keys so you don’t have to move your hands when you’re coding

http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329

Vim Casts | http://vimcasts.org/

Pluralsight – Smash into Vim | http://pluralsight.com/training/courses/TableOfContents/smash-into-vim

Vim adventures | http://vim-adventures.com/

Vi / Vim graphical cheat sheet | http://www.viemu.com/vi-vim-cheat-sheet.gif

Sando Search – code search

http://visualstudiogallery.msdn.microsoft.com/06f39a31-20ce-408c-afee-8a02b484db1c

Resharper

http://www.jetbrains.com/resharper/

OZ code – download installer. among other things, it allows you to search for a specific value when you are iterating over a large set of values, and skip to that searched value when you are debugging

http://www.oz-code.com/

More Tips & Tricks


(These notes are a bit sloppy, but you can look at Latish’s blog or google a topic to find further explanations if one of these sparks your interest).

 

Import IDE settings from other people, or switch between your own pre-saved settings

https://studiostyl.es/

 

Scrollbars – Map Mode

visual representation of your document and your current window scope (love it)

 

Right Click on the Solution => clone a Solution Explorer window

 

Pending Changes Filter in solution explorer shows you what you’ve changed since the last commit (and push/pull??) Open files filter (Self explanatory)

 

Solution => Properties => Startup Project => Multiple Startup Projects

 

Pin To Source – watch a property in real time while you are debugging

 

You can export and import breakpoints

 

Hover over a value – magnifying glass / code visualizer?

 

Latish’s Links