This may seem like a completely obvious tip to some, and like a complete waste of time to others. But you know what? Its something that I've found extremely useful so I'm going to share it anyhow.
Hey, this is my blog and I can do what I want! :)
Update: I forgot to explain how to enable Highlight Current Line in the original post. I've now added instructions.
Highlight Current Line
This feature is not available in vanilla Visual Studio - its part of my favorite zero-friction productivity enhancer, ReSharper. I'm sure other productivity add-ins like CodeRush/Refactor! have something similar, but I don't know for sure. Maybe one of my friends can confirm... looking in your direction Dustin and/or Jay.
Anyhow, you can see it in action in the screen shot to the right.
Notice the slight variation in contrast between the standard background color and that of line #27. That's the highlighted current line.
The key for me not getting too much contrast between your standard background and the highlight color.
For a dark background you'll want a highlight that is just a few shades lighter, and for a light background you need a shade that is just a bit darker. The highlight should be obvious, but subtle. The point is not to distract your eye, but just to give it a visual cue.
OK... so?
So why exactly is this important, helpful, or even relevant? For two reasons:
- It makes finding your cursor extremely easy when navigating through your code base, which is really important when moving at the lightning fast speeds made possible by ReSharper and keyboard shortcut-fu.
- I like shiny things... and eye candy. And that's exactly what this is. :)
So how do I enable it?
First you need to turn the option on, and to do that you'll need ReSharper. So:
- Install ReSharper, FTW!
- In Visual Studio, open the ReSharper -> Options dialog.
- Open the Editor section.
- Check the "Highlight current line" option.
Next you need to set a custom highlight color, which you'll probably want to do because the default one is pretty ugly... and doesn't work well with dark themes. To do that:
- In Visual Studio, open the Tools -> Options dialog.
- Open the Environment -> Fonts and Colors section.
- In the Display items list, find the ReSharper Current Line and set your custom color.
Or the easy way...
If you're interested, you can grab the color scheme seen above (a variation on VibrantInk) from the CodeIncubator project's code repository. You'll find it in the IDE-Settings directory under VisualStudio.
Well, there you have it. Another possibly pointless usability/productivity tip from my IDE to yours. Enjoy!
