views:

3174

answers:

5

How do I make all occurrences of a phrase (search term) in a file to be highlighted in the VS code editor?

+2  A: 

When you run a "find" you can click "bookmark all" which will identify on the left which lines the search terms occur on, but you can't "highlight" the elements using visual studio, out of the box.

Andrew Theken
+3  A: 

If you use the CTRL-i short cut, it'll do an inline incremental search. Keep pressing CTRL-i to jump to & highlight each subsequent occurence in the file.

I'm not sure that you can highlight all occurences at once. It may be possible with a plugin like ReSharper but not that I'm aware of.

Eoin Campbell
That's exactly what I was looking for!
Jacob
+8  A: 

Hi,

I noticed that a nice side effect of the Rock-Scroll plugin is that when you double-click a keyword it highlights all occurrences in the file (and in the rock scroll preview) as well.

http://microsoftdev.blogspot.com/2008/05/rock-scroll-visual-studio-plugin.html

Hope that helps, Alex

AlexDuggleby
Thanks! I'll check it out.
axk
That's awesome, thanks!
Michael Haren
+5  A: 

ReSharper can do this with the Highlight Usages feature: Highlight Usages In File

Course, you need ReSharper ;)

remotefacade
That doesen't work in .js files :-(
Roberto Sebestyen
+1  A: 

I have just done a quick google for this very feature.

Came up with these results

VS 2008 http://visualstudiogallery.msdn.microsoft.com/en-us/ad686131-47d4-4c13-ada2-5b1a9019fb6f

VS 2010 http://visualstudiogallery.msdn.microsoft.com/en-us/4b92b6ad-f563-4705-8f7b-7f85ba3cc6bb

Chris F