Highlight usages in file

I sometimes use ctrl-shift-f7 to highlight all usages of a variable in a file. My quesiton is once they are highlighted and I have what I need how do I make the variable not highlighted anymore? There isn't a readily apparent why how to turn it off.

9 comments

Esc (it's only possible to clear all hightlights at once)

0

If you press escape, it will cancel the highlights.

0

Thanks! That has been annoying me. Now the question is why didn't I think about hitting the ESC key? It sounds obvious now since I know :)

0

Hmm, odd. ESC isn't working for me. The highligths remain even after hitting ESC.

0

Ahh ok. I use the VIM Emulator plugin and that intercepts the ESC key.

Is there anyway to turn them off other than the ESC key? I don't really want to have to turn of my VIM emulator everytime I want to turn off the highlighting.

0

You can remap the key if you want, I can't really think of any other way to turn them off!

Go to the Keymap settings, go into the "Editor Actions" branch and change the key for "Escape" to another key.

0

With regards to that functionality, I seem to remember that in the past when pressing ctrl-shift-f7 on different references, the color used was progressively different: do I remember well or not? If yes, was this provided by a plugin or is it a lost feature?

0

I am not sure what you mean by progressively different.
Idea has a feature that is a little strange to use, but quite useful:
If you do not have an editor selection Idea searches semantically,
for example with the caret after a variable called 'i', it will
highlight all occurences of that variable in purple (read and write
accesses in slightly different hues).
If you do have a selection, for example starting in front of 'i' and
ending after the 'i', Idea will just highlight each and every 'i'
character in the file in green.

BTW: Please note that if you highlight something the status bar says
"press Escape to remove the highlighting".

0

I also remember it and would love to get it back.

0

Please sign in to leave a comment.