views:

440

answers:

5

ViM has this option hlsearch where a searched string is displayed in highlight mode at all places in the file it is found. Is there a way to do the same in Visual Studio?

That is, if I search for "foobar", then all the foobar in the file are shown highlighted and this display remains until my next search. I find this very useful to see the places in a function where a certain variable is used (without having to manually search for the next appearance of that string).

I am aware of the Visual Studio Task List which can be used to look up strings like TODO. I hope the reader realizes that this is not a good fit for my problem which is more general text search and highlight.

+1  A: 

I use the RockScroll add-in. It has multiple features, one of them is that if you double click on a word it will be highlighted everywhere in the file. This is very similar to what you describe. It is free (as in beer).

Dani van der Meer
Thanks so much Dani! This is exactly what I was looking for. Also, the compressed display on the side is also useful.
Ashwin
Actually, that highlighting feature of RockScroll drives me mad. I suppose it's a matter of taste, but I really don't like it. Is there a way to disable it in RockScroll?
DrJokepu
I am not aware of a way to disable it.
Dani van der Meer
+7  A: 
David Klein
Thanks David. If my ViM withdrawal symptoms become stronger, I'm definitely getting this addin ;-)
Ashwin
A: 

If you happen to really like Vim, you might want to look into ViEmu for Visual Studio . I'm just a really happy user of it :)

tomasr
+2  A: 

Visual Assist X does this, along with something akin to light-symbol-mode. Among other things, of course.

Ben Straub
Could you explain how to enable or use this Visual Assist X feature?
Ashwin
It's in the options, under Refactoring: "Automatically highlight references to symbol under cursor."
Ben Straub
A: 

Visual Studio 2010 now supports Reference Highlighting. Click on or move the cursor to any symbol such as names of variables, classes, methods, properties, etc. and it will highlight all other references in the file. It also allows you to navigate between the references using:

ctrl+shift+down arrow or ctrl+shift+up arrow

Ray Vega