Highlight all occurrences of selected word


This extends the editor to highlight all occurrences of a selected word and place a glyph on the left margin.

(90) Review
Visual Studio
Download (132,889)
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Reviews (90)
Q and A (33)
Sign in to write a review
Sort by:

by f_max | February 25 2015

by R e i | December 04 2014

How do you change the color?? Can't find the entry in options> fonts and colors setting

by fascy | January 29 2014

Really cool plugin, something I was missiing from other IDE's. One thing could be upgraded: I personally prefere, when I select a variable ( double click ) the higlight should remain. ( just like in Eclipse for instance)

by KlosterLiqueur | January 08 2014

Usefull, but could be more usefull if the selected word had a different colour than the highlighted ones.

For example when searching, you don't know which of the highlighted words is the currently selected and thus quite confusing.

(See how e.g. notepad++ does the highlighting)

by Anastasius80 | November 13 2013

Visual Studio 2013 -> Version 12 hinzufügen...

1. Download the plugin and save it to your desktop as SelectionHighlight.vsix
2. Rename the file to SelectionHighlight.zip
3. Edit the extension.vsixmanifest file in the zip to add a Visual Studio 11.0. It should look like this when you're done:
<VisualStudio Version="10.0">
<VisualStudio Version="11.0">
<VisualStudio Version="12.0">
4. Save this new extension.vsixmanifest to the desktop (you can't save directly into the zip folder)
5. Copy the new extension.vsixmanifest back into the SelectionHighlight.zip
6. Rename SelectionHighlight.zip to SelectionHighlight.vsix
7. Doubleclick SelectionHighlight.vsix to install it into VS2013

by nZeus | November 05 2013

It's a great tool!

Please add VS 2013 support.


by Venkat Narayanaswamy | October 10 2013

Simple and great tool to use.

by rcohn53 | September 26 2013

This is a very nice extension and helps productivity immensely.
Matching highlighted text quickly helps you find the places in the code that you're looking for.

Nice work.

(This is really a gvim idea.)

by Dmitri Shvetsov | September 06 2013

It works nice but has the following drawback. If you use Ctrl+F3/F3 keys to navigate through lastly searched word, it doesn't show visually which one is currently active (selected). So my use case is:

Let's say I have a 'Program' class and 'bar' member variable as shown in the screenshot. I want to quickly search and see 'bar' occurrences. I put my cursor on 'bar' word and press Ctrl+F3 and then keep pressing F3. That way I am navigating through all occurrences of 'bar' word. Now the issue is that if there are several occurrences on the same page and when the plugin is enabled, I simply don't see which one is active (selected). Without plugin the current (active) occurrence is selected and you can clear see it.

The bottom line is that the currently selected occurrence (the one which the cursor is on) should be highlighted a different way (e.g. using other color).

by jcamilli | July 22 2013

I love this! Thanks.
But WHY is this not a standard feature in VS?????

by Guilherme Morais | June 06 2013

MUST HAVE!!! Thanks!!!

by coderfin | May 02 2013

I wrote an extension called Accent Occurrences to replace this one. It can be found at http://visualstudiogallery.msdn.microsoft.com/2f4627df-98ca-4ce1-9187-8eec7a67ba8c.

The Accent Occurrences extension adds an accent/highlight feature to Visual Studio that allows you to quickly see all the occurrences of a selected word or selected characters.

- Customizable colors for background, border, font, and glyph [TOOLS → Options... → Environment → Fonts and Colors → Accent Occurrences (Box/Font/Glyph)]
- Hold the Ctrl key while selecting text to make the search case sensitive

by Jay Boppana | April 18 2013

by GarryWww | March 13 2013

Does what it says, but has the side effect of making any instance of drag-across-to-select-text painfully slow. Oops.

by 4eburek | February 07 2013

Visual Studio 2012 version you can find here

by Ahmad Bilal Chaudhary | January 15 2013

by Антон Данейко | January 10 2013

by e.battulga | December 02 2012

Want to install in Visual studio 2012
1. Download and rename .vsix to .zip
2. open 'extension.vsixmanifest' and find 'SupportedProducts'
3. Add this:
<VisualStudio Version="11.0">
<VisualStudio Version="12.0">
4. Save and rename .zip to .vsix
5. Double click to Install

by Marat Turaev | November 25 2012

by Munyul | November 22 2012

+ Very easy to download/install.
- I would prefer the matching to be case sensitive.
- Would be AWSOME if it only matched matching instances - Eclipse does this for Java, but I'm not sure if this is possible in C/C++!? Would be AWSOME if it could be done! :)
- Options would be nice, Colour, Case sensitive on/off, etc.

Either way, I recommend this plugin, as some matching is BETTER than none!

1 - 20 of 90 Items   
Sign in to start a discussion

  • Changing the color
    8 Posts | Last post September 04, 2014
    • Like others here I use a black(dark) theme and the color choice of Lime Green does not work for me.  Is there anyway to either allow us to change to color or maybe release the source so we can?  I like the way this works compared to the built in IDE method but for me it iends up being LimeGreen abckground with white foreground which is not readable.
    • Please fix this or release the source code so we can.
    • In addition to allowing the change of the background color, please make the currently selected item distinct from the others by using a different color or shade.
    • Not recommended to those who use dark backgrounds with lighter fonts.
    • it's a super hackey way to do it, but as stated below you can edit the hex of the DLL (%LocalAppData%\Microsoft\VisualStudio\10.0\Extensions\Microsoft\Highlight all occurrences of selected word\1.31\SelectionHighlight.dll), hopefully an update is released that works better than that, but this gets the job done
    • cs9
      To change the default backgroud color, open  "SelectionHighlight.dll" in a hex editor and replace the string "get_GreenYellow" with a new color name: http://en.wikipedia.org/wiki/Web_colors#X11_color_names, e.g. "get_Pink". Patch unused bytes with 0x00.
    • If you're not sure about the Hex edit approach,
      You can download my edited version from https://www.dropbox.com/s/mlwds6u26isw8g3/SelectionHighlight.dll
      Next go to "C:\Users\YOURNAME\AppData\Local\Microsoft\VisualStudio\11.0\Extensions\"
      11.0 corresponds to VS2012, switch to 12.0 in the path for VS2013 and likewise. (Switch YOURNAME in the path to your username)
      Run a search for SelectionHighlight.dll and when found replace that file with the one you got from dropbox. 
      You should be done.
    • Thanks for that cs9. I simply opened the dll in UltraEdit and changed "get_YellowGreen" to "get_ForestGreen" (which happens to be the same length so that's perfect) and its working a treat
  • Do you have this for Visual studio 2013?
    2 Posts | Last post May 15, 2014
    • Do you have this for Visual studio 2013?
    • this url: http://visualstudiogallery.msdn.microsoft.com/24f8c2a3-7175-42ed-8b37-fd618279c312
  • Visual Studio 2012
    6 Posts | Last post November 11, 2013
    • Awesome plugin but cannot find it for VS2012
      Does it work in VS2012 or are you planning to add it?
    • +1
    • I found the way to use this extension in VS 2012.
      .vsix file is .zip archive file, so you can rename it and unpack.
      Then you can find extension.vsixmanifest file, where are defined supported versions of VS =) So I just modified supported versions of VS and packed that file back.
    • Andrew, works like a charm!! Thank you so much!!
    • Yes this works! The version for 2012 is 11.0
    • If you use NuGet to install the extension, you won't have to modify any .vsix file. I just installed it with my 2012 edition and it worked fine.
  • VS 2010 express
    4 Posts | Last post September 24, 2013
    • I'm using the 2010 express edition.
      Does this extension should work?
      I'm getting the following message when trying to install "This extension is not installable on any currently installed products"
    • VS express editions don't allow extensions, sorry.
    • It's sad. :(
    • me too, how to install? (vs2010 express)
  • Not case sensitive
    1 Posts | Last post August 23, 2013
    • Looks like the highlighter ignores case. Too bad...
  • Possible bug in highlighting words after symbols
    2 Posts | Last post July 03, 2013
    • Hello
      I think there is a bug in the plugins in which it cannot highlight the words that are after symbols such as "(),[]{}" and so on.
      For example, if I select myVar in the following code, it will miss the second one:
      myVar = "Something here"
      call(myVar, anotherVar)
      I would be thankful if you give me a solution or solve this problem.
    • The extension I wrote does not have this issue.  http://visualstudiogallery.msdn.microsoft.com/2f4627df-98ca-4ce1-9187-8eec7a67ba8c
  • Source code for this
    2 Posts | Last post May 02, 2013
    • Is its source code available? I want to change highlight color as I am using black theme.
    • I wrote an extension called Accent Occurrences to replace this one.  It can be found at http://visualstudiogallery.msdn.microsoft.com/2f4627df-98ca-4ce1-9187-8eec7a67ba8c.
      The Accent Occurrences extension adds an accent/highlight feature to Visual Studio that allows you to quickly see all the occurrences of a selected word or selected characters.
      - Customizable colors for background, border, font, and glyph [TOOLS → Options... → Environment → Fonts and Colors → Accent Occurrences (Box/Font/Glyph)]
      - Hold the Ctrl key while selecting text to make the search case sensitive
  • Control Button + Mouse click to go to method definition
    7 Posts | Last post January 15, 2013
    • This extension disabled the Control + mouse click option to go to method definition. Can anyone help me to fish this issue. Thanks
    • This problem present for Visual Studio 2010 and 2012 both.
    • Perhaps my last post about conflicting extensions has something to do with that. Do you use some other extension to do ctrl+click jumps? Because it seems it is not a default behavior (at least for C++).
    • Thanks, You are right. Its not default feature of Visual Studio. This functionality is part of Productivity Power Tools extension. Thanks again for making clear to me. My next question, is there any solution for this conflict.
    • Since we use different plugins for the navigation, but have the similar problem, one might conclude, that there must be something wrong with the highlighting extension. It would be nice to hear from Nicholas.
    • I have disabled this plugin for now in favor of Productivity Power Tools. Now I select the word, hit ctrl+F and see the word highlighted.
    • Thanks, once again. I found one problem with ctrl+F way of highlighting words. This method not only highlights the variable name (word) but if that word is a part of some other variable, then word also highlighted in other variable. Thanks a lot.
  • Conflicting extension detected
    1 Posts | Last post January 11, 2013
    • Hi, it seems I have found some kind of conflict with another extension: "Go To Definition" (http://visualstudiogallery.msdn.microsoft.com/4b286b9c-4dd5-416b-b143-e31d36dc622b)
      The extension makes ctrl+click on an identifier to behave like F12 (go to definition). 
      My usual use case is to double-click an identifier, look at it's highlighted occurrences in the current context (thanks to your extension) and then ctrl+click it to go to the definition. When I disable your highlighting extension I can navigate using ctrl+click, otherwise I get the highlighting on ctrl+click. 
      It is reproducible on a tiny snippet like this:
      #include <iostream>
      int main(int , char**) 
          int myint = 5;
          std::cin >> myint;
          myint += 1;
          std::cout << myint;
      I am using VS 2010 and the 1.31 version of your extension (2.4 version of that other extension).
      Could you suggest any workaround?
  • Version of Plugin 2012
    5 Posts | Last post November 30, 2012
    • Thank's Jay Thaler!
      I followed in his footsteps, edited and shared the file, follow the link below:
    • Thanks for the upload !
    • Thanks Jean, but I didn't want to sign up to download the file. Here's a link to the edited version from my DB. 
    • Thanks for posting yours via DB. Worked great.
    • 东西是不错,可惜不支持VS2012。
1 - 10 of 33 Items