Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
3  
@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
1  
@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
1  
@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
2  
@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
2  
@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
show 3 more comments

1 Answer

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
add comment

Your Answer

 
discard

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.