39

There are so many little options and settings within Microsoft Visual Studio. Which adjustments do you recommend to others?

swilliams
  • 48,060
  • 27
  • 100
  • 130
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280

25 Answers25

39

Line Numbers

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

Visual Studio Line Numbers

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
  • 6
    I'd prefer Cntrl + g to go to a specific line. :) – RWendi Oct 09 '08 at 20:57
  • 5
    Line numbers are helpful when you're working, locally or remotely, with another developer. "Look at lines 25-30." – Michael Petrotta Oct 09 '08 at 21:26
  • 4
    WEll you can just look at the status bar and check the line you are instead of having 1/4 inch took for nothing about 95% of time ;) – Patrick Desjardins Nov 03 '08 at 20:20
  • 3
    Like Daok said - this seems like HUGE waste of space and I don't think I can ever remember needing them. CTRL-G also works for me. – Tim Dec 29 '08 at 16:38
  • 1
    Line numbers also indicate how much is hidden inside collapsed regions, something you can't see from a single number on the status bar. – Ed Guiness Mar 08 '10 at 10:38
16

Environment->General->Animate environment tools => OFF.

Speeds UI responsiveness by 82%.

Soraz
  • 6,610
  • 4
  • 31
  • 48
14

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) Visual Studio Preferences
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
John Sibly
  • 22,782
  • 7
  • 63
  • 80
8

Tools -> Options -> Environment -> Keyboard

Setup a shortcut to close the active document. Ctrl+Alt+W in my case.

AEM
  • 1,354
  • 8
  • 20
  • 30
Mark S. Rasmussen
  • 34,696
  • 4
  • 39
  • 58
8

Gotta have the tab indention set up right.

Also, Consolas & Color Themed - white backgrounds hurt my eyes

thismat
  • 2,096
  • 17
  • 24
8

Option Strict On

Tools > Options

Projects and Solutions > VB Defaults

Default project settings: Option Strict: On

Option Strict

Spooky
  • 2,966
  • 8
  • 27
  • 41
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
6

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?

steffenj
  • 7,967
  • 10
  • 35
  • 41
  • You will if you have a team where one developer doesn't like the default tab width. – Joel Coehoorn Oct 09 '08 at 20:49
  • That is just a display issue and can be configured on each computer without affecting anyone else. However, if one developer does have "tabs to spaces" on and all source files he touched are converted to spaces ... well, that just sucks. – steffenj Oct 09 '08 at 21:38
  • 2
    I totally agree - to save others time: Tools > Options > Text Editor > All Languages > Tabs > Keep tabs – Cory House Nov 17 '08 at 14:33
  • 1
    getting your team to use anything but the default settings is an uphill battle. – Dustin Getz Jan 27 '09 at 17:51
  • and you can use intelligent diffing software if you do run into whitespace commits. – Dustin Getz Jan 27 '09 at 17:51
  • 8
    I hate to start a religious war, but only infidels would check in files with \t instead of spaces. – Frank Schwieterman Aug 04 '09 at 22:59
  • I don't get it, why are tabs evil? I've never had any issues. – rball Apr 19 '10 at 22:01
  • "Insert spaces" is evil, If by any reason code gets indented when typing a '}' then all tabs upwards are converted to spaces. That is really a pain in the @ss when diffing the change log, or even worse when doing a Blame (thats the name of the operation in TortoiseSVN, don't know how it's commonly knonwn in other tools) of the source file. – Fede Apr 22 '10 at 13:37
  • 2
    When I see code with TAB indentation, there are always some lines with SPACE indentation too: sometimes one presses spacebar automatically to indent a 1 or more spaces, visually aligning the cursor with other code. Mixed tabs & spaces only work with one specific tab size, and backspace will behave inconsistent. Expand to spaces if you want to be sure your code is consistently indented. @steffenj, @Fede The "my DVCS will complain once" argument can be used against implementing any coding standard. – catchmeifyoutry Sep 02 '10 at 00:12
5

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:

  1. Download and extract PDF
  2. Send to favorite full color printer/copier
  3. Hang on wall
  4. Code
  5. Smile
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
4

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

lyngbym
  • 669
  • 2
  • 10
  • 11
  • 1
    I personally find this distracting. A keyboard shortcut that found the active item would be nice though. – Greg Jan 27 '09 at 18:17
  • I found it distracting too. So I use Add-in (http://www.codeproject.com/KB/macros/VSHelper.aspx) to quickly find document when I need it. – Juozas Kontvainis Apr 24 '09 at 07:18
4

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

Alan
  • 6,501
  • 1
  • 28
  • 24
4

Prevent Visual Studio from renaming pasted controls

How do I prevent Visual Studio from renaming my controls?

Community
  • 1
  • 1
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
4

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

Redwood
  • 66,744
  • 41
  • 126
  • 187
4

Visible white space. (Edit -> Advanced -> View White Space)

Free Image Hosting by FreeImageHosting.net

The default color is too strong. I immediately change it to silver. (Tools -> Options -> Fonts and Colors -> Visible White Space).

Silver visible white space

On some displays, even silver is too strong, and I create a "light silver".

Free Image Hosting by FreeImageHosting.net

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Jay Bazuzi
  • 45,157
  • 15
  • 111
  • 168
  • 1
    This would be easier to follow if your screenshots weren't overly compressed. Next time you might want to use png rather than jpeg, it is lossless and for screenshots without embedded photos usually ends up smaller than a resasonable quality jpeg. Make whitespace visible using: Edit>Advanced>View White Space or pressing Ctrl+E,Ctrl+S To set the colour, use Tools>Option>Fonts and Colors>Visible White Space. – Mark Booth Mar 24 '10 at 14:45
  • Thanks @Mark. FreeImageHosting.net isn't doing a great job for me, either. I've edited to state the menu items in the text. – Jay Bazuzi Mar 27 '10 at 15:29
4

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.

codeConcussion
  • 12,739
  • 8
  • 49
  • 62
3

Fixedsys Font

Tools > Options

Environment > Fonts and Colors

Font: Fixedsys

Visual Studio font

Spooky
  • 2,966
  • 8
  • 27
  • 41
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
3

Always show solution

Tools > Options

Projects and Solutions

Always show solution

Always show solution

Spooky
  • 2,966
  • 8
  • 27
  • 41
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
2

Source View

Tools > Options

HTML Designer > General

Start pages in: Source View

Visual Studio Start pages in Source View

Spooky
  • 2,966
  • 8
  • 27
  • 41
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
2

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

Community
  • 1
  • 1
Jobi Joy
  • 49,102
  • 20
  • 108
  • 119
2

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.

MPelletier
  • 16,256
  • 15
  • 86
  • 137
2

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.

BenR
  • 11,296
  • 3
  • 28
  • 47
2

When designing a form:

View > Tab Order

Allows you you specify and control your TabIndexes easily (much more so than setting them by hand!)

MPelletier
  • 16,256
  • 15
  • 86
  • 137
1

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.

Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231
1

Un-Bold Brace Matching

Tools > Options

Environment > Fonts and Colors

Display items: Brace Matching (Hilight)

uncheck Bold

Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
1

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.

Scott Dowding
  • 13,749
  • 1
  • 16
  • 10
0

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

Tools > Options > Keyboard

Kon
  • 27,113
  • 11
  • 60
  • 86