views:

666

answers:

7

Is there a way that I can configure Visual Studio 2008 to understand CamelCase? Specifically, I'd like to be able to get ctrl + right or left cursor to take me to a subsection of a variable or type name.

i.e., if my cursor was at the start of this line:

LongNamedExampleClass longNamed = new LongNamedExampleClass();

and I hit ctrl + right, I'd like to jump to "Named" in the class name, rather than the start of the variable name. If I hit it again, I'd like to go to "Example". I hope that makes sense...

I used this navigational feature in eclipse quite a lot, and find it difficult to unlearn something so ingrained.

A: 

I don't think Visual Studio supports this feature internally, as it seems to be using the normal way Ctrl+Right and Ctrl+Left work in Windows environment. But it's probably possible with some kind of extension or plugin.

Mehrdad Afshari
+2  A: 

Resharper supports that feature.

Petter Wigle
A: 

Visual Studio does not support this behavior. However, DevExpres's CodeRush! product supports navigation like this (using Alt-Left & Alt-Right), along with tons of other features to aid in navigation. The CodeRush! product is also bundled with their Refactor tool. They also offer a free CodeRus! & Refactor Express product, though I'm not certain if the Camel Casing navigation is part of the express product.

Steve Brouillard
+1  A: 

Resharper does that. I suppose you could write your own addin to do the same.

open-collar
+2  A: 

It's not native to Visual Studio, but you can get it for free using CodeRush Express. (ReSharper and CodeRush require payment).

Stewart Johnson
+3  A: 

Thanks for those who suggested Resharper. Gives me another reason to love it even more. Just to be specific about where this lives - JetBrains call it CamelHumps (cute) and you can switch it on using the menu:

Resharper -> Options -> Editor -> Use CamelHumps

serg10
A: 

Does anyone know how to do the opposite: Make Eclipse operate like Visual Studio? I want my Ctrl+Left/Right to ignore casing.

mpderbec