Once I saw people using Matlab use a keystroke shortcut that made all the same symbols as a selected symbol become blue. I am wondering is there is a function in Mathematica that is similar. If so, what's the keyboard convenient shortcut. (Of course, Ctrl+F can be made to do something a little similar, but that is not what I'm looking for.)

  • 5
    $\begingroup$ The IntelliJ plugin does this. $\endgroup$
    – Szabolcs
    Commented May 24, 2014 at 2:15
  • $\begingroup$ @Szabolcs I guess the right question is to ask which text editor can perform this function. So, is IntelliJ plugin usually the text editor for MMA user? $\endgroup$
    – Lawerance
    Commented May 24, 2014 at 17:42

1 Answer 1


An editor can only do this if it has enough understanding of Mathematica code to be able to tell which symbols are localized to what scopes. This is far from trivial, so there aren't many tools that can do this.

To my knowledge the Mathematica Front End does not do this type of highlighting (even though it does know what symbols are local and indicates this using syntax highlighting). To conveniently use "Find" in a notebook, select a word, press Command-E to set it as the search term, then press Command-G to cycle through hits. (These shortcuts are for OS X, check the Edit menu on other systems.) This is just dumb text search and it doesn't know about symbols or localization.

Wolfram Workbench is a powerful IDE for Mathematica, and can do this, as well as general structural manipulations on Mathematica code. Select a symbol, right-click, and choose Find References.

There's a great Mathematica plugin for IntelliJ IDEA which also has sufficient understanding of Mathematica code to highlight multiple occurrences of the same symbol, taking into account localization. This is done automatically as you type. See how it underlines the symbol name:

enter image description here

Both Workbench and the IDEA plugin are meant for package development, and can only edit plain text files, but not notebooks. If you do interactive work, stick to the Front End. For developing packages that will be maintained for a while, these two IDEs are excellent.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.