I quite like the way Notepad++ does this particular feature. As soon as you select a piece of text that could be an identifier, it will highlight all nearby matches, and when you deselect again the highlight is removed.

It is quite convenient for quickly seeing places a variable is referenced in a source file.