Coloring numbers differently from letters in visual studio

1

IS it possible to have Visual Studio highlight numbers in a different color from the standard alphabet characters a-Z?

In Gvim, 1-9 is colored in bright pink and the letters in black. With the fonts my Visual Studio 2012 provides it is very hard to distinguish between 0 and o and 1 and l. Coloring them differently would solve the problem.

smilingbuddha

Posted 2013-11-06T15:52:20.687

Reputation: 1 591

Answers

2

You can change the color for numbers by going to Tools->Options selecting "Fonts and Colors" from the Environment category and then select "Number" in the "Display Items" list. You should then be able to select a color for the numbers in your code.

Note, however, that Visual Studio's coloring is based more on context in your code rather than just text, so some numbers (in string literals for example) may not be colored the same.

heavyd

Posted 2013-11-06T15:52:20.687

Reputation: 54 755

0

I presume you mean numbers in the middle of a variable name or something like that ? (After all, plain numbers like constants already get a different color trough the normal syntax highlighting.)

E.g You would like to have the 1 in "My1stVar" colored differently from the a-z characters.

As far as I know that isn't possible in the VS suite. The syntax highlighting only works on 1 level: classifying text as having a specific use and color it accordingly.
This would require a second level to distinguish between the individual characters.

You can change the font itself though, for something that has better visual distinction between these characters.

Tonny

Posted 2013-11-06T15:52:20.687

Reputation: 19 919