Developers spend most part of the day with Visual Studio and using shortcuts and hidden features would definitely improve the productivity.
I’m presenting few tips and Tricks along with hidden features and customizations for the developers. Please add any new features in the comments section.
- Full Screen Mode
Developers sometimes get distracted with the alerts and there is a solution for that. Alt-Shift-Enter toggles from regular view to full screen mode, so you can see a lot more code. Windows Task bar is also hidden and definitely productive.
- Copy/Cut a line of Code
We don’t have to select a complete line to copy or delete it, use CTRL-C/CTRL-X anywhere in the line.
- Saving And Restoring Visual Studio Settings
Tools –> Import and Export Settings can be used to export the settings to an other machine.
Visual Studio default settings can be restored by selecting “Reset all Settings”
- Select a rectangular area of text.
Hold Alt down and drag mouse over text area you like to select.
- Conditional Breakpoints
If you’re debugging through a loop, waiting for something specific to happen—like a variable to have a specific value—use the Conditional Breakpoint capability. When you set a breakpoint, right-click on its red blob and choose “Condition…” in the popup menu.
- Use line numbering on your source code editor.
Using line numbers largely improves productivity, especially when four eyes are looking at a code and discussing it. Turn on line numbering by going to the menu Tools | Options. Look for Text Editor | All Languages | General and check the
“Line numbers” checkbox.
- View different parts of the same document.
Sometimes, it’s good to view different parts of the same document for reference purposes. At the very top of the scrollbar, there’s a little rectangle. Click and drag that down for two windows into the same code file. When done, simply drag back the splitter to collapse the window.
- See List of 10 Recent Projects in window menu, Not Just 4
On the Tools->Options->Environment, you can have Visual Studio show the 10(Maximum is 24) most recent projects you’ve opened, rather than just the most recent 4. (This also works in Microsoft Office and many other applications.)
- Find in Visual Studio IDE
Ctrl+F is known to all developers to find a word or string in current document, all open documents or entire project or entire solution. One other hidden option is Ctrl+Shift+F, this is helpful by listing results in a find window unlike navigating one by one in every file where the searched word/string exists.
- Incremental Search
To incrementally search for text as being typed, first press
Ctrl+i. Then type the word to be searched. Hit backspace to clear a character and enter to finish. Pressing F3 after this will work as usual, i.e. search for the next occurrence of previous search.
Ctrl+iworks like F3.
- Important Shortcuts in Visual Studio IDE
Ctrl+Alt+L – Opens Solution Explorer
Ctrl+Alt+X - Shows Toolbox
F4 – Opens properties window
Ctrl+\+E – displays error list
Ctrl+\+T – displays tasklist
Ctrl + M + M – Expanding and collapsing code blocks
- Surround with code Snippet (C#)
Snippet can be placed around a code block using shortcut CTRL+K+S.
- Image library by Microsoft to use in Visual Studio applications
During the Visual Studio setup, the VS2008ImageLibrary.zip file is installed at \Program Files\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary\
I will keep updating this post, please let me know if you know of any tip.
HAPPY PRODUCTIVE CODING