Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any easy way of directly jumping to the definition of a Variable like it is implemented in some good IDEs? Currently I have to search manually (ctrl+f) through the whole workbook to find it somewhere.

share|improve this question
@Ferio: I don't think it is possible to solve this in general. As in Mathematica there can be many definitions for one symbol and these could in principle be distributed over different locations and files there isn't something like single point of definition. Maybe that's the reason why no such functionality is available. When you use a personal convention to mark where a certain symbols definition appears it should be simple enough to write something. If you are interested in such an approach I'd suggest to indicate that in your question and I'm sure you'll get some help... – Albert Retey Mar 8 '13 at 9:32
@Nasser: I think the problem with source line numbers is that the structure of a notebook-expression isn't line oriented: there isn't anything like a defined line number within a notebook. This has been discussed several times in questions about Mathematica files and version control systems, which you can search if interested in more details. When used as a package file editor, it would in principle be possible to define line numbers and the package-file editor for Wolfram Workbench actually has them... – Albert Retey Mar 8 '13 at 9:38
@Nasser: what is somewhat ridiculous is the fact that Get reports line numbers for syntax errors in package files but you need external editors to actually find those lines. So yes, there seems to be room for improvement... – Albert Retey Mar 8 '13 at 9:40
@Ferio Have a look at wolfram workbench. I gave up on the front end for writing packages and I don't regret it at all. – Ajasja Mar 8 '13 at 13:31
@Ajasja is right. The workbench is more convenient for writing things. Would have been nice if we had the workbench features in the frontend... – acl Mar 8 '13 at 13:56

If you use package files, ie, files with extension .m which contain mathematica code in plain text; create one from File->New->Package:

enter image description here

there is a button which lets you jump to the definition of symbols:

enter image description here

Clicking it shows a list of functions:

enter image description here

(although it gets confused sometimes, as you can see in this screenshot); clicking on a symbol name usually takes you to the assignment (if eg you have them all in one cell, this doesn't work...).

Now, the m-editor is not ideal, but better than searching. Note that by default it does not keep the indentation when you press return; this may be changed as described here. Also, block-indenting in this editor is impossible...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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