Useful Dev features in Visual Studio

Posted by

Enable Code Lens:

Code lens is a very useful feature where the scroll button in the Visual Studio Editor is replaced by the Code Lens. It lets you take a peek into the part of code you mouse-over on the
Scroll-bar.
To enable it, go to Tools->Options and enable check-box as shown below:

You can also selectively set other code lens features as shown in the screen-shot above.

Splitter:

Above the Code Lens is the splitter as shown below. It lets you split your code-Editor screen into 2 parts when you click, hold and drag it as shown below:

The below screenshot is divided into two code-editors. On the above part, you can move around say do Ctrl+Home to go to the top of the file.

On the below part, do Ctrl+End to move to the bottom of the file.

Ctrl + M + O

This short-cut lets you collapse the entire code file as per regions.

Create #regions

Using #region and #endregion, you can divide your code-sections into collapsible regions in your .cs file.

Ctrl+;

This lets you quickly move to the search bar of your Solution Explorer and search for files in your Solution.

Navigate Forward and Backward

If you want to quickly navigate between current and previous cursor positions in same or different code files, you can do as follows:

Navigate backward: Ctrl + –
Navigate forward: Ctrl + Shift + –

The Navigation buttons are also available under the File Menu as shown:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.