Visual studio shortcuts

Its always time consuming to use all the features provided by an editor while coding (if you don;t know the hotkeys). For example, Visual Studio. When you are using a big editor like Visual Studio, you will have soo many functionalities to use while you code. Most of the time, these features goes unnoticed when you can’t find the shortcuts for those. Also the shortcuts will be too big to remember. Below mentioned ones are really handy. I will be talking from the C# point of view. So I really don’t know whether all these will work for all the languages.

AutoHide

VS has got loads of windows, tool bars and stuffs. You can’t see everything at the same time unless you have a really big screen. So every window will have a AutoHide button. When you click that, the window goes in to a dock. You need to hover the mouse over those to get it back in to the screen. This is really a good thing, but you get frustrated at time because of this. For example, when you work with a big solution file, where you have around 20 to 25 projects, your Solution Explorer shows all those, but to open a project you need to hover the mouse over the tab. Though to switch from keyboard to mouse. I understand. Hit Ctrl + Alt + L to see the Solution Explorer. F4 to see the Properties window (really handy while UI designing), Ctrl + Alt + X to see the Toolbox, Ctrl + Alt + O to see the Output window.

We can open files from the Solution Explorer without using the mouse. Hit Ctrl + / and type of><file_name> and hit Enter to open the file

Go to definiton

In the code editor, while you write codes, you may wanna see the definition of a class. What we usually do is right click on the keyword (class name) and say Go to definition. Instead try F12.

Find referenes

Wanna know where you have used a particular word in the entire solution ?? Use Right click over the word > Find references or Shift + F12. Handy isn’t it ?

Source viewer and Design viewer

You may be designing some UI control and you may feel like going to Source view to check something. In such a case, use F7 to toggle between them.

Debugger

While in debug mode the following hot keys are essential,

F9 to toggle a breakpoint, F10 to step over, F11 to step in (go in to the function calls), Ctrl + Shift + F10 to delete ll the break points, Ctrl + F10 in a statement to run to cursor, Ctrl + Alt + P to open the Attach to processes window

Commenting

Select the statements you wanna comment and try Ctrl + K and Ctrl + C to comment them. To uncomment, hit Ctrl + K and Ctrl + U. If you wanna include the xml summary for the methods and classes, move the cursor above the required method or class and type ///

Formatting

Hit Ctrl + K and Ctrl + D to format the statements (aligns the statements). If you wanna move your cursor to the previous location, hit Ctrl + -. Hit Ctrl + L to delete a line. Ctrl + F to open Find window Ctrl + G to open GoTo line window. Ctrl + H to open Find and replace window.

Refer here for even more.

These are some of the hotkeys that I use often. If you know anything else, you can always add it as a comment.

Tags: , ,

Leave a comment