Visual Studio settings to ease your development experience

I wrote this piece long time ago for my colleagues who just started to develop on .NET and they were pretty green on using Visual Studio as an IDE for development.

1. Useful configurations

All the settings of Visual Studio can be found under the Options menu
Tools -> Options

1.1. Show the line numbers

-> Text Editor -> All languages -> Line numbers

1.2. Automatically track the current active item in the solution explorer tree

-> Projects and Solutions -> Track active item in Solution Explorer

1.3. Set a keyboard shortcut for sorting the usings

  • > Environment -> Keyboard -> type “Edit.SortUsings” in the “Show commands containing:” text box.
  • Then go to “Press shortcut keys” and press the wanted shortcut.
  • Ensure you are not overwriting any existing shortcut combination.
  • Place the System using at the top:
                -> Text Editor -> C# -> Advanced -> Place system directives first when sorting

1.4. Save your settings

It’s a good idea to save and export your settings setup in case of resetting or messing them later on.

Tools -> Import and export settings -> Export selected environment settings

2. Snippets

You can access all the snippets with the following combination:

Ctrl+K, Ctrl+X

You can either select an area where you want to insert a snippet or write the snippet itself and then press Tab.
I am listing some of the most useful and used ones

●    for / forach – type it and press Tab and it will create a the for (or foreach) block for you with the opening and closing brackets as well.
●    ctor – for creating of a constructor
●    try – this will create a try – catch block
●    if – you’ve guessed it!

3. Bookmarks

If you want to put a bookmark on some line just place the cursor there and then click the image for toggling a bookmark from the Bookmarks tab (it can be opened from View -> Other Windows -> Bookmark Window). There is a shortcut as well: Ctrl+B + T. Then you can navigate through the bookmarks again from the Bookmarks window.

4. Others

●    Peek definition (Alt+F12)

“You can use the Peek Definition command to view and edit code without switching away from the code that you are writing.“

●    Word wrap

Edit -> Advanced -> Word Wrap (Ctrl + E, W)

●    Show the white spaces

Edit -> Advanced -> View white space (Ctrl+E, S)

●    Quickly create a GUID

Tools -> Create Guid

●    TODOs
You can always type // TODO: <some to-do text here> if you have to mark a piece of code as something which needs to be continued later on. All of the TODOs can then be found in the Task List (View -> Task List)

5. Shortcuts to remember

There is a good article about it with a topic: 10 Visual Studio shortcuts you must know, so check it out.

There are many more functionalities and configurations you can play with that powerful IDE and make your coding faster, cleaner and easy going.

2 thoughts on “Visual Studio settings to ease your development experience

  1. Very useful.The one should bookmark the article if she is bored to google this information every time.

    Like

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