Stephen Walther had a great, practical post recently on his blog with a set of tips and tricks to help developers make better use of Visual Studio 2008. I have to admit I didn’t know many of these tips and wonder what else I might be missing. I will pay better attention to shortcuts as I run across them.
Here is a summary of the tips, but check out Stephen’s post to see them in action:
- You don’t need to select a line to copy or delete it, use CTRL-c
- You can add a namespace automatically by pressing CTRL-.
- Never create properties by hand
- You can remove and sort unnecessary using statements
- Use CTRL-k+c to comment out code
- You can close all documents except the current one
- You can open a database by double-clicking the database file in App_Data
- You can copy a file or folder into a project by dragging and dropping
- Use CTRL-SPACE to perform statement completion
- Add new items by pressing CTRL-N or CTRL-SHIFT+A
- You don’t need to type file extensions when adding a file
Reading the comments in this post is worth the time as well with some other useful tips:
- CTRL-x to delete the current line.
- CTRL-r+e to encapsulate a class variable into a property.
Another source of shortcuts is the Visual C# 2008 Poster from Microsoft, a PDF cheat sheet for magical key bindings. I also use ReSharper (R#) which has many keyboard shortcuts and it maps to some of the key bindings used by Visual Studio to supplement the features, which is nice.