views:

92

answers:

3

In the DOS era I used a text editor (forgot the name) which had a outstanding feature. Whenever i was over a function call, hitting a key combination it took me to the function definition. Also, when I was in the function definition, I was able to see all calls to that function. Something like

This function is called from:

  • function1, line 154, source1.c
  • function3, line 500, source2.c

I loved this feature and I miss it. Is there any actual editor with a feature like this?

I'm on windows, but if I can get this function, i'm capable of buy a mac :-D (kidding)

Update I'm using php. My example was with .c files because I used that editor with c

+1  A: 

The most recent versions of Kate, KDE's advanced text editor, come with a plugin called ctags that does exactly what you want. Since KDE 4, you can install some KDE programs in Windows thanks to the KDE on Windows project. Kate is one of those you can install.

Once you have launched it please go to Settings -> Configure Kate..., choose Plugins from the left pane and enable the ctags plugin.

Kaze no Koe
ok, I'll take a look.Does it support utf-8 and sintax highlight for php/html/css?
The Disintegrator
It supports UTF-8, and as I recall, syntax highlighting, but I don't know if it has presets for those languages (I'd imagine so though, they are pretty common)
Matthew Scharley
It has presets for a ton of languages including markup languages. It supports themes, that is you can choose what colors should be used for highlighting various elements. It supports both UNIX and Windows end-of-line. It supports sessions. Basically it's another thermonuclear text editor like emacs but a little lighter.
Kaze no Koe
jajajaj, ok, downloading. This will take a while
The Disintegrator
A: 

Since your example returns function call results from multiple files, you probably want not a simple text editor but rather an IDE (Integrated Development Environment) for C. What you describe is a standard feature probably present in every modern-day C(++) IDE. From my personal experience, Visual Studio (e.g. Visual C++ 2008 Express Edition) supports both "Go to definition" and "Find references".

Heinzi
well, actualy I'm using php. My example was wit .c files because I used that editor with c
The Disintegrator
A: 

As mentioned previously, this is possible on just about every modern editor. To name a few alternatives in case you're still looking:

ctags has been mentioned. cscope improves on ctags by actually parsing the code so that it can distinguish between, say, the search string in a comment and the search string in actual code. Not sure how it handles callbacks in PHP, since you guys just pass in the function name as a string, right?

vim integrates with ctags and cscope, as does emacs.

vim, I believe, also has a built-in ability to go from a call to the definition, and (implemented as simple string searching) to cycle through calls of a function. It also has the neat feature of querying documentation (by default, man pages, but configurable to other things) on a function name. These are one one-keystroke commands. vim is available on Win32 either as a text-mode client or a GUI app (called gvim).

Wang