Search code examples
phpstorm

PhpStorm highlight all instances of current selected variable (text)?


You can check this the image below, I've marked $articles, but I want everywhere in my file $articles to be marked, like in other editors, for example you can check image 2:

image

image2

I tried everything I found on Google but without success, most of them worked for PhpStorm 2017, but not for 2018.


Solution

    1. Settings/Preferences
    2. Editor | Color Scheme | General | Code
    3. Identifier under caret and Identifier under caret (write)

    These are the styles that allow to do what you want (Note: it works with identifiers only (e.g. variables/properties) and will not work with plain random words (e.g. a word from the string content). You may try BrowseWordAtCaret plugin if you need that to work with any word.

    enter image description here

    P.S. There is also Search Results section down below -- similar styles but for Find functionality.