Visual Studio Shortcuts

It may sound a little overemphasizing but shortcut keys save time, the millisecond of time that it takes to move our hands, from the keyboard to the mouse, actually adds up over the day. Using shortcuts is the key to working efficiently in our programming environment. Visual Studio has excellent support for utilizing the keyboard. 

Here are a few standard shortcuts that can boost our productivity:

1. Inserting code snippet 
Snippets are a useful feature in the Visual Studio IDE. With them, you can type a few letters and then press tab twice to insert a code fragment. For example to insert a constructor you type ctor and press tab twice. A related feature is "Surround With" for which keyboard shortcut is Cntrl+K+S.
Here is the complete list of all code snippet:

2. Remove unused using: Keyboard shortcut is Shift + F10+ O+R
        Some of the advantages of removing unused namespaces are:
            Cleaner code- makes it easy to read and maintain.
            IntelliSense runs faster as there are fewer items to look through.
            Faster compilation because the compiler has fewer namespaces to lookup types to resolve.
Avoids name collision in future when new types are added to the unused namespaces that have the same name as some types in the used namespaces.

3. Collapsible Regions: 

If you select a section of code and then use the key sequence <CTRL><M><H> you turn that region into a collapsible/expandable region. The key sequence <CTRL><M><U> will remove the collapsible region.
A shortcut key for toggle single outlining is Cntrl+M+M and toggle all outlining is Cntrl+M+L.

4. Using Bookmarks:

You put Bookmarks in various places in your code to go back there and do something. It speeds up navigation in the code. Bookmarks can be set by pressing Cntrl+K+K. To view all the Bookmarks use Cntrl+W+B to bring up the bookmark window.


5. Immediate Window 
It’s very useful during debugging to evaluate an expression, execute statements and print values. The keyboard shortcut is Cntrl+Alt+I or Cntrl+D+I.
    

6. Task List Window 

It allows you to keep track of the TO DO things you have set in your code.  Comments marked with TODO appear in task list. The keyboard short cuts for opening the task list window is: Ctrl+Alt+K. You can add your own set of comment tokens e.g. TODO comment .For this goto > Tools|Options|Environment|Task List|Comment Tokens and make your changes.



Listing all the shortcuts is beyond the scope of this article. To see the complete list check this out.
http://visualstudioshortcuts.com/2013/

Comments

Popular posts from this blog

What are delegates in .Net and why do we need them?