In this article we will talk about features, shortcuts, and tips for Visual Studio 2015 which will make you more comfortable and a hundred times more productive with the IDE you are working in.
Shortcuts
- To go to a specific Tab or Location.
Press Ctrl + Tab, and the following pop-up will be displayed and you can specify the tab you want to go to.
- To bring the quick actions light bulb in view.
Press Ctrl + .
- To Bookmark a line of code.
Press Ctrl + K
- To increase font size, Press Ctrl + Shift +
To decrease font size, Press Ctrl + Shift +
- While intellisense, no doubt is an extremely helpful tool, but sometimes you wish you could peek at the code behind the intellisense window. Simply, hold down the Ctrl key to see through the code hidden behind it.
After holding down the Ctrl Key.
- Formatting code:
To format your code and to bring it back to order.
Press Ctrl + K then Ctrl + D
- Define Properties of a private field:
Write Prop and then press Tab Tab for the following syntax.
And PropFull and then Tab Tab for the following syntax.
- Peek definition by pressing Alt + F12 and Esc to close.
- To move a line or set of selected line, use Alt + Up Arrow/Down Arrow.
- Go to a specific line number Ctrl + G.
- Have you ever wished to select a piece of code vertically! Wish no more, simply hold down the Alt key and select text vertically.
- To Comment code press, Ctrl + K, Ctrl + C.
To Uncomment code press, Ctrl + K, Ctrl + U
- For surround-with code snippets, use Ctrl + K, Ctrl + S
IDE Features
- Task List: can be used to keep track of comments like TODO, UNDONE, HACK or even customized tokens.
To open the task list go to View -> Task List.
- Lazy Code Snippets: Allows you to drag and drop the selected code to toolbox and place it under one of the sections or create one of your own. Now this piece of code will be available in all of your projects and you won't have to retype it, a simple drag and drop as required will be enough.
So, now you why it's called LAZY.
- Quick Launch: is a search tool, but instead of searching through code, it searches through the visual studio itself.
Let's suppose you want to turn on the line numbers, but you can't find the option. All you have to do is type line numbers in the quick launch bar, which is situated at top right corner of the VS window and it will display all the results it could find after searching menus(@menu), most recently used(@mru), options(@opt), open document(@doc) and NuGet packages(@nuget)
As you can see, the search result returns the location of line number, Options, Text Editor, All Lanuages, then General.
- Preview Tab: allows you to quickly glance at file without actually opening it in a new tab.
However, if you decide to open the file, you can do that by clicking on the Keep Open icon which is on the left of the cross for closing the file.
Bonus Tips
- Display Number of Lines: Go to Tools, Options, Text Editor, All Languages, then Line Numbers.
- Offline Help: Go to Help, Set Help Preference, then click Launch in Help Viewer
- Feedback: Next to the Quick Launch Bar is a feedback icon, which allows you rate product, send suggestions and report a problem.
Read more article on Visual Studio 2015: