7

In eclipse, when i click on a variable with the mouse (you know, the cursor is somewhere in the variable name), eclipse is useful enough to highlight all other occurrences of that variable in the file. I assume pycharm has this, but have no idea how to turn this on.

I knew how to do it at one stage, but it was (from memory) a keyboard thing that i had to keep pressing for each new variable. If the highlighting is possible, how do i keep it on?

Cœur
  • 37,241
  • 25
  • 195
  • 267
bharal
  • 15,461
  • 36
  • 117
  • 195
  • possible duplicate of [IntelliJ: How to auto-highlight variables like in Eclipse](http://stackoverflow.com/questions/3763183/intellij-how-to-auto-highlight-variables-like-in-eclipse) – CrazyCoder Jun 06 '12 at 03:53

2 Answers2

15

You need to enable this setting:

highlight usages of element at caret

But this question is actually a duplicate of IntelliJ: How to auto-highlight variables like in Eclipse.

Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
2
Edit > Find > Highlight usages in file.

There's a keyboard shortcut noted there for your OS

Hedde van der Heide
  • 21,841
  • 13
  • 71
  • 100
  • this is nice, - but it doesn't *update* the hilighting when i move the cursor! I have to *keep* hitting the keyboard shortcut to get it to work, which is pretty bogue. Is there no way for pycharm to keep on hilighting whatever the cursor is on, even when the cursor moves to a new word (in which case the new word & its occurances would be hilighted)? – bharal Jun 05 '12 at 16:53
  • I'm not sure if it's possible to remap your mouse behaviour, maybe at preferences. Offtopic: I do know that jetbrains tends to take suggestions really seriously so you might want to place tickets at their site to get these things working in future updates – Hedde van der Heide Jun 05 '12 at 16:58
  • no no - i did not mean the mouse, i meant the cursor, the little blinking thing! If i move the cursor via the keyboard i'd expect the same thing. – bharal Jun 05 '12 at 17:04