Reputation: 5394
How do I make all occurrences of a phrase (search term) in a file to be highlighted in the VS code editor?
Upvotes: 14
Views: 23195
Reputation: 332
CTRL + F3
TIP: Use SHIFT+CTRL+F3 to "step backwards"
Upvotes: 2
Reputation: 5131
I open the file in Notepad++ and VS.
Update:
I recently found this extentnion for VS that makes it behave like notepadd++! You just need to select a phrase and it will highlight all of them.
Highlight all occurrences of selected word
Upvotes: 0
Reputation: 1037
You can use metalScroll extension - it is like rockscroll but it has rich and very useful functions. You can download this on:
http://code.google.com/p/metalscroll/downloads/list
go through with this before use:
http://code.google.com/p/metalscroll/
Upvotes: 7
Reputation: 1743
Microsoft has an (actually) useful VS plugin which solves this issue.
Power Tools: http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/
Once installed (restart VS afterwards), either highlight a section of text an hit CTRL+F to iterate all occurrences, or highlight text and let VS mark all matches for you in syntax highlighting.
Upvotes: 3
Reputation: 979
I copied and pasted the source code into Word 2007. This has highlight all option called 'Reading Highlight'. This keeps the highlighting on even when you search for another term.
Upvotes: 0
Reputation: 7715
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
Upvotes: 7
Reputation: 359
ReSharper can do this with the Highlight Usages feature: Highlight Usages In File
Course, you need ReSharper ;)
Upvotes: 11
Reputation: 8038
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
Upvotes: 16
Reputation: 44268
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.
Upvotes: 4
Reputation: 3480
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.
Upvotes: 6