What are your most-recommended Visual Studio preferences? [closed] - visual-studio

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
There are so many little options and settings within Microsoft Visual Studio. Which adjustments do you recommend to others?

Line Numbers
Tools > Options
Text Editor > All Languages > General
Display: Line Numbers

Environment->General->Animate environment tools => OFF.
Speeds UI responsiveness by 82%.

I've never found dynamic help to be either dynamic or helpful, and just tends to slow visual studio down, so using regedit:
registry key:
HKEY_CURRENT_USER\Software\Microsoft\Visual Studio\x.x\Dynamic Help
value:
Never Show DH on F1 = yes
I'm also keen on setting the following in Options->Projects and Solutions:
Show Output window when build starts - checked
(IMHO easiest way to spot build errors)
Track Active Item in Solution Explorer - unchecked
(stops every project ending up fully expanded in Solution Explorer)

Gotta have the tab indention set up right.
Also, Consolas & Color Themed - white backgrounds hurt my eyes

Option Strict On
Tools > Options
Projects and Solutions > VB Defaults
Default project settings: Option Strict: On

Tools -> Options -> Environment -> Keyboard
Setup a shortcut to close the active document. Ctrl+Alt+W in my case.

Personally i hate that VS defaults to "Tab to Spaces" when you are developing in C#. This is so awkward to work with and unnecessary.
Yes, i know there are issues with Tabs but honestly, did any of you ever encounter them coding in C# on Windows?

Several have mentioned custom keybindings. Here are handy default keybinding reference posters…
Microsoft Visual Basic Default Keybindings reference poster
A high quality, print-ready PDF
containing the useful keybindings for
developers that choose the Visual
Basic developer profile in Visual
Studio 2008 or use Visual Basic
Express.
Microsoft Visual C# Default Keybindings reference poster
Visual C# in Visual Studio 2008 and
Visual C# 2008 Express Edition Wall
chart showing useful keyboard
shortcuts for Visual C# programming
language.
I like Microsoft's instructions:
Download and extract PDF
Send to favorite full color printer/copier
Hang on wall
Code
Smile

Set the active document you're working on to display in the solution explorer. I've seen a lot of people hunting for their current doc if the project gets too big.
Tools -> Options.
Make sure show all settings is checked.
Click on Projects and Solutions.
Enable the Track Active Item in Explorer checkbox.
alt text http://img370.imageshack.us/img370/4821/trackactivedocumentqv2.gif

Environment => General => Recent files
24 items shown in Window menu
24 items shown in recently used lists
Environment => General
Show status bar ON
Animate environment tools OFF

Prevent Visual Studio from renaming pasted controls
How do I prevent Visual Studio from renaming my controls?

Window Layouts
This really isn't a setting but something I always do is back up my settings via Tools > Import and Export Settings.
I make sure to back up my window layouts for both single and multiple monitors. It saves frustration when moving from my multi-monitor setup to a single monitor for a presentation.
Not to mention, it makes it easy to get up and running on a new PC.

Visible white space. (Edit -> Advanced -> View White Space)
The default color is too strong. I immediately change it to silver. (Tools -> Options -> Fonts and Colors -> Visible White Space).
On some displays, even silver is too strong, and I create a "light silver".

I'm somewhat surprised to be the first person recommending Visual Studio Hacks for a lot of suggestions of this variety

Fixedsys Font
Tools > Options
Environment > Fonts and Colors
Font: Fixedsys

Always show solution
Tools > Options
Projects and Solutions
Always show solution

Check out this thread for the Color theme options for Visual Studio
https://stackoverflow.com/questions/141371/which-visual-studio-color-theme
And consolas is my favourite font

This applies to winform projects.
Instead of opening the form in design mode by default, you can configure VS to open the code editor instead. This is configured by right-clicking on a form in the solution explorer and choosing the "Open with" option. This gives you a dialog that allows you to specify the default option when double-clicking on a file.

In a control's properties, setting GenerateMembers to false for items you don't need (labels, etc). It's not a specifically Visual-Studio thing, more related to the platform, but mixed with the contextual list of objects and functions, it just clears up so much clutter.

When designing a form:
View > Tab Order
Allows you you specify and control your TabIndexes easily (much more so than setting them by hand!)

Source View
Tools > Options
HTML Designer > General
Start pages in: Source View

Its all about Resharper ;) Gives you tons of shortcuts which are so useful I can no longer work without them. I don't get on with the intellisense though, so I've turned that off.
This is incredibly useful, allows you to write underscores with the space bar when writing long test method names.

Un-Bold Brace Matching
Tools > Options
Environment > Fonts and Colors
Display items: Brace Matching (Hilight)
uncheck Bold

Find and Replace window’s "Search Hidden Text" checkbox.
It's not really a preference but it is indispensable. It sure is frustrating when you don’t notice that it "magically" unchecked itself.

Besides, Line Numbers, the first thing I always do in a newly-installed IDE is set the Edit.GoToDefinition keyboard shortcut.
Tools > Options > Keyboard

Related

Three combos on the top of visual studio 2013 code file

I have Visual studio 2013, resharper 8.2 and the productivity tools power pack.
My visual studio has 3 combos at the top of the code editor instead of the normal 2.
The combos are:
project, class and members.
I want to get back to normal:
classes and members.
Any idea which of the following is causing it, and how ti disable this specific features?
I don't think as things currently stand that you can disable it, but its name is apparently "Context Switcher".
According to this MSDN blog, it would appear to be a new feature intended to help you manage shared files in Universal Apps. I agree that it's confusing, and I'm not a big fan.
A thorough search of the VS options for anything related to "Navigation Bar", "Context Switcher", or "Universal Apps" comes up empty and there don't seem to be any extensions offering this capability either. As far as I know these would be the main avenues for configuration, so my conclusion is that we are stuck with it until the next VS update or until someone gets around to making an extension that can disable it.
If you prefer, you can disable the navigation bar entirely in "Tools > Options > Text Editor > All Languages > Navigation Bar" (or you can disable the bar on a language by language basis.)
Update: As of Visual Studio 2013 Update 3, you can drag and adjust the relative sizing of the 3 drop down lists in the navigation bar.
From a little local testing it looks like the sizing you set is shared between all files and solutions and it persists after closing and reopening visual studio.
I shrank the context switcher down to just the visible text, and it feels more well proportioned and closer to the classic Class and Member drop down layout.
The answer comes from this Stack Overflow page

Is it possible to hide outline margin in Visual Studio 2012?

In Visual Studio 2012 it's a lot of margins to the left of source code text: Indicator Margin, Selection Margin and Outline Margin. As an old programmer i prefer an uncluttered text, so i want all 3 margins to be hidden from me. In Text editor settings i can hide indicator and selection margins, but i didn't found how to hide an outline margins. Outline graphics (all this "+" things and ines) can be easily hidden from "edit" menu, but margins itself remains. Is it possible to hide it or such feature is not implemented? In previous versions of Visual Studio it auto-hides if "selection margin" was disabled, but now it seems that it don't hide at all :(.
Update
A little clarification why I need it. As correctly mentioned in comments, it's very unusual to have preferences for text formatting and appearance. I agree with that. Unfortunately, in my personal case, I work with text like 10 hours per day for dozens of years and my brain is kind of trained to calculate indentation from text editor left edge. And every time I work in Visual Studio my "wrong indentation" instinct is often triggered by this empty space :). Of course i can re-train myself, but since ALL editors except Visual Studio displays text close to left edge, I will try to configure Visual Studio first.
Turn off the Indicator margin with Tools + Options, Text Editor, General, untick "Indicator margin"
Turn off the Selection margin with Tools + Options, Text Editor, General, untick "Selection margin"
Turn off the Outline bar with Edit + Outlining, Stop Outlining. That is however liable to come back when you open a new file. You can make it consistent for the C# IDE with Tools + Options, Text Editor, C#, Advanced, untick "Enter outlining mode when files open". If you want to do this for other kinds of files as well then you need to write an add-in that listens for the DocumentEventsClass.DocumentOpened event.
I've created an extension for this, it's for VS2015 but if you haven't upgraded yet it should work for VS2012 as well (assuming you're using an edition that supports extensions). The source code is only a few lines and is shown in the screenshot of the posted link.
http://blogs.msdn.com/b/saraford/archive/2007/09/13/did-you-know-you-can-hide-outlining-selection-margin-without-turning-off-outlining.aspx
Tools – Options – Text Editor – General, and uncheck Selection Margin...
This work?
Go to VisualStudio->Tools->Options
Drill down to Text Editor->C#->Advanced and uncheck "Enter outlining mode when files open"
Other language editors have similar options to disable outlining mode.
Any files you have open before changing this setting need to be re-opened, or you can turn off outlining from the context menu for each open file. Easier to just close/re-open.
Hope that helps!
Here's an extension that worked perfectly for me: https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings
It has custom options to hide/show:
the entire margin
breakpoint margin
line numbers
selection margin
I can't tell if anyone actually answered your question (which is mine today!). Please see http://www.codeproject.com/Articles/109611/Color-Indicator-for-Code-Changes-Track-Changes-in and particularly the "Enable / Disable" section: "Go to Tools > Options > TextEditor. In General section, you can check or uncheck the 'Track Change' option."
Agree this feature is a big visual hassle during initial development, but it can be helpful during "maintenance" changes.
Corrected per "external link" comment.

How to hide reference counts in VS2013?

Visual Studio 2013 introduced a new feature where it shows you how many times each of your methods are used.
I don't find it very useful, and it messes up the spacing of my file. How do I disable it? Can't seem to find the option.
I guess you probably are running the preview of VS2013 Ultimate, because it is not present in my professional preview. But looking online I found that the feature is called Code Information Indicators or CodeLens, and can be located under
Tools → Options → Text Editor → All Languages → CodeLens
(for RC/final version)
or
Tools → Options → Text Editor → All Languages → Code Information Indicators
(for preview version)
That was according to this link. It seems to be pretty well hidden.
In Visual Studio 2013 RTM, you can also get to the CodeLens options by right clicking the indicators themselves in the editor:
documented in the Q&A section of the msdn CodeLens documentation
Another option is to use mouse, right click on "x reference". Context menu "CodeLens Options" will appear, saving all the navigation headache.
Workaround....
In VS 2015 Professional (and probably other versions).
Go to Tools / Options / Environment / Fonts and Colours.
In the "Show Settings For" drop-down, select "CodeLens"
Choose the smallest font you can find e.g. Calibri 6.
Change the foreground colour to your editor foreground colour (say "White")
Click OK.
The other features of CodeLens like: Show Bugs, Show Test Status, etc (other than Show Reference) might be useful.
However, if the only way to disable Show References is to disable CodeLens altogether.
Then, I guess I could do just that.
Furthermore, I would do like I always have, 'right-click on a member and choose Find all References or Ctrl+K, R'
If I wanted to know what references the member -- I too like not having any extra information crammed into my code, like extra white-space.
In short, uncheck Codelens...
In VSCode for Mac (0.10.6) I opened "Preferences -> User Settings" and placed the following code in the settings.json file
"editor.referenceInfos": false
User and Workspace Settings

Visual Studio Formatting -- Change Method Color

The default appearance of a method for example, ".ToString()" is by default the color black. I want to make it a different color to stand out but I do not see any options that reference this option specifically.
I remember one of former collegues showing me his VS IDE years ago and he had it setup this way but I cannot recall what he did.
Does anyone have any ideas on how to do this?
In VS 2019 go to Tools - Options - Text Editor - C# - Advanced - Editor Color Scheme and change it to Visual Studio 2019. Method names are now colored and everything has little bit better colors.
You can do this with an extension: SemanticColorizer is what I use.
Tools -> Extensions and Updates -> Online -> Search for SemanticColorizer
It allows you to modify the colors of methods, static functions, constants, member variables, and just about anything else you can think of.
For Visual Studio 2010
Tools > Options
Environment > Fonts and Colors
Change "User Types"
To change the color of the Method Calls go to
Tools > Options > Environment > Fonts and Colors > User Members - Methods > Item foreground Color > Select desired color.
This will also work in Visual Studio 2019.
Go to Visual Studio "Tools>Options>Environment>Fonts and Colors" the menu shows a "Display Items" list, select "Identifiers"(out of which 'methods' is a member). Use the format controls to personalize the displaying of your chosen item. Unfortunately, variables, instances and namespaces are members of "Identifiers" so they will affected too.
If you are using Resharper then a more specific list of items is displayed.
For myself, I wrote a simple, lightweight "editor classifier extension" for Visual Studio based on the async Roslyn APIs to Syntax Highlighting user tags in C# and Visual Basic code.
It has syntax highlighting for:
"Events"
"Fields"
"Fields (Constant)"
"Fields (Inside Enums)"
"Local Variables"
"Methods"
"Methods (Extension)"
"Methods (Static)"
"Namespaces"
"Parameters"
"Properties"
In the future, perhaps coming on the "syntax highlighting" for something else.
You can install this extension from the Visual Studio Marketplace by following the link below:
Download: "Enhanced Syntax Highlighting".
You can change the syntax highlighting settings by going to "Tools" > "Options" > "Environment" > "Fonts and Colors" > "Text Editor" and scrolling to properties starting with the prefix "User Tags - ...".
The syntax highlighting options for "Classes", "Delegates", "Enums", "Interfaces", "Modules", "Structures" and "Type Parameters" are just below, they have the prefix "User Types - ..." and are built-in default.
Good luck.
The built-in syntax highlighters use lexical analysis. A lexer can classify identifiers, comments, literals, numbers, keywords. The parts you find back in the Tools > Options > Environment > Fonts and Colors dialog.
Recognizing that an identifier is a method, property, field requires parsing. Parsing generally only works well when you've got a well-formed program, you rarely have one while you are typing code. So wasn't favored by Microsoft. You can find alternatives in the Visual Studio gallery.
Thanks to "#Ian" said User Types. For me "User Members - Methods" worked.
Tools
Options
Enviromment
Fonts and Colors
In Display items: "User Members - Methods"
Change Item foreground
Semantic Colorizer didn't work for me (VS 2019 Preview).
Enhanced Syntax Highlighting did exactly what I needed.
Tools > Options > Environment > Fonts and Colors has an extensive list of things you can change both font face, font size, color, style, etc.
Also, Jeff Atwood had a great post a few years ago about IDE font and colour schemes that you might find interesting.
In a previous version of visual studio (I think 2010) there was a plugin that allowed you to color code methods. I don't remember the name of it now as we have continued to progress forward in versions. The author did not keep up with the version updates of VS.
Update: VS10x allows you to color code methods in Visual Studio all the way through VS2015. A link to the authors Visual Studio Galleries page can be found here: https://visualstudiogallery.msdn.microsoft.com/1c54d1bd-d898-4705-903f-fa4a319b50f2?SRC=VSIDE
I am currently using this in VS2013 successfully.

enabling design view in VS 2010

Does anyone know where can I enable the bar that let me switch between different views (Design,split,..) in Visual Studio 2010 ? I can't find it and it is not enables by default
If you go into the Visual Studio Tools -> Options menu, under HTML Designer -> General there is a checkbox to enable or disable the HTML designer. Checking this and restarting VS will do the trick and show the Design/Split/Source options at the bottom again.
I really prefer the Code Optimized setup but do need on occasion to hit the design view, shame it does not seem easier to expose and, when exposed, takes up more UI than it really needs to.
Do you have the Design/source tabs down in the bottom left corner of the window? (just above where your debug & immediate windows appear from in the default view). If you do, look further to the right of them, there is a splitter bar you can drag up to produce the split mode.
It's a corrupt installation, try reintall the VS
I also cannot see the Design/Source tab split. I could have sworn it was in VS2010 RC. Did they take it out of retail?? (I'm working with an Activity xaml file)
go to Tool->Option->General->Enabe Html Designer

Resources