I alway use vi to edit Fortran files. I can use ctags to know which variables and functions I have already defined. Now I use vi to edit Mathematica *.m files. I tried to use ctags for *.m files, but it does not work. I have searched for the solution in Google but no luck. Could you give me some suggestions?
Assuming you mean vim for vi, you could build a searchable index that may be an acceptable compromise.
Suppose that you have a searchable convention that you use for marking each function. The obvious one to me is one where you precede each function with a usage, like
That would allow use of grep to build an index that you could use with vim -q (although that's not quite as nice as tags that you could follow). For example:
or, if you want a more constrained search, say just foo:
I'd imagine that it's possible that you could use Mathematica itself to read all your Modules and build a call graph of all the functions and variables defined along with their filename and line numbers. If that was done, it's probably not too much harder to make Mathematica produce a ctags format file that you could use within vi.
[EDIT] The ctags format isn't that complicated. Here's a quick hack of a perl script that can generate it (again provided that you have a ::usage for each symbol of interest)
This probably works for non-vim vi's too.