Dark Visual Studio 2010 theme

Looking for a refreshing change in colour? Getting sick of coding against that glaring white background? Look no further!

I’ve decided to upload my Visual Studio 2010 Fonts and Colors settings for public consumption. The colour scheme is loosely based on the Railscasts TextMate theme. Here’s a couple of screenshots to give an idea of appearance:

(Click to view larger).

To install:

By default, the theme uses Consolas size 12. You can adjust these settings easily by opening menuĀ Tools -> Options and finding the Fonts and Colors section under Environment.

Note that Visual Studio is a prick, and has something in the order of 100 different colours that can be set. I have only set up colours for things that I am commonly doing, such as coding in C#, HTML, or XAML. Every now and then you might come across a colour that looks funny against the dark background. This can of course be modified by hand in the Color settings by tracking down the appropriate item in the colour list.

Visual Studio tip

If you’re like me, the way that Visual Studio 2008’s Solution Explorer jumps around to select the file in the current tab makes you disoriented and frustrated. Fortunately, I have found the ideal solution!

Not sure if this works in other versions of Visual Studio, but it’s working a treat for me!

Next big thing

I have something of a prediction. If not a prediction then a wish. A wish for a feature that should become part of IDEs everywhere, in much the same way that IntelliSense-esque tools and refactoring tools have.

To explain the feature, first let me explain the problem it solves. Supposing I have a number of similar lines of code:

Item1.Text = GetData("Item1")
Item2.Text = GetData("Item2")
Item3.Text = GetData("Item3")
Item4.Text = GetData("Item4")
Item5.Text = GetData("Item5")

… and I want to make a similar change to each of these lines, such as:

Item1.Value = Convert(GetData("Item1"), String)
Item2.Value = Convert(GetData("Item2"), String)
Item3.Value = Convert(GetData("Item3"), String)
Item4.Value = Convert(GetData("Item4"), String)
Item5.Value = Convert(GetData("Item5"), String)

Currently, I can use tools such as Find and Replace to replace e.g. “.Text = GetData(” with “.Value = Convert(GetData(“, but replacing “)” with “), String)” is a bit more tricky. For that I would probably copy and paste “, String)” onto the end of each line. Either way, this is a very repetitive task. And if there’s one thing that we know, it’s that computers are excellent at automating repetitive tasks. I would love a tool that, after I’ve changed a couple lines, spots the repetition and intelligently asks if I want to apply the same modification to subsequent similar lines – ideally with a preview to check accuracy.

Another example. Supposing I have a list of blank <select> options that I’ve quickly copied and pasted ready for population:

<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>

… and I fill the lines in like so:

<option value="Item1">Item1</option>
<option value="Item2">Item2</option>
<option value="Item3">Item3</option>
<option value="Item4">Item4</option>
<option value="Item5">Item5</option>

Again, I would fill in the first couple of lines, but this one would work a bit differently. The tool would realise that the value and text of each item is the same, and automatically fill out one based on what I type in the other. I.e. I’d type “Item3” into the value field of the third option, and it would automatically put “Item3” as the inner HTML. Taking it a step further, in this particular example, it could also pick up the sequential numbering of items, and suggest to fill out the remaining items automatically. A step further again, and you could get it to work with e.g. form elements or project datasource columns, to automatically produce entire forms and classes based on a bit of initial prompting – i.e. write out some code that mentions the first and second columns of a given datasource, and it suggests lines of code similar to the lines entered, but with the other column names.

Of course this tool is completely hypothetical – at least as far as I’m aware… But in theory would not be too drastically hard to create, and would save developers everywhere a lot of time; I’m allowed to dream, aren’t I? If it became a reality, it would be a huge feature – the next big thing perhaps?