Friday 5 February 2016

Visual Studio 2015, Shortcuts, Features and More

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:

1)  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.



2) To bring the quick actions light bulb in view
    Press Ctrl +  .

3) To Bookmark a line of code
     Press Ctrl + K

4) To increase font size, Press Ctrl + Shift + .
    To decrease font size, Press Ctrl + Shift + ,

5) 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.
 










6) Formatting code:
    To Format your code and to bring it back to order
    Press Ctrl + K then Ctrl + D

7) 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















8)   Peek definition by pressing Alt + F12 and Esc to close

9)   To move a line or set of selected line, use Alt + Up Arrow/Down Arrow

10)  Go to a specific line number  Ctrl + G
 
11)  Have you ever wished to select a piece of code vertically! Wish no more, simply hold down the Alt key and select text vertically.

12)  To Comment code press, Ctrl + K, Ctrl + C
       To Uncomment code press, Ctrl + K, Ctrl + U 

13) For surround-with code snippets, use Ctrl + K, Ctrl + S

IDE Features

 1) 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 

 2) 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.

 3) 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->General.

4) 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:

 1) Display Number of Lines: Go to Tools > Options > Text Editor > All Languages > Line Numbers
  
2) Offline Help: Go to Help > Set Help Preference > Launch in Help Viewer

3) Feedback: Next to the Quick Launch Bar is a feedback icon, which allows you rate product, send suggestions and report a problem.


 

No comments:

Post a Comment