Brent Simmons points out, in this blog post, that much of programming is just navigating around, which is only well supported in IDEs, not Text Editors, and even IDEs only get it right with languages that are structured to allow for it (eg: C# works great, PHP not so great, Obj-C is in between).
My solution, as someone who built my own text editor, is to have really good search. In particular:
Search should be fast
Even on an SSD equiped mac, TextMate beachballs for a long time when searching 250,000 files (totalling 3GB) for the search term "b". My app finishes searching in 10 seconds, and shows the first several thousand results within a millisecond of releasing your key from the keyboard.
With a moderate search, say 8,000 files and 250MB, TextMate takes 13 seconds and
my editor barely even blinks a
UIProgressView onto the screen before hiding it again, the search is finished faster than you can type.
It does this using a pretty innovative Grand Central Dispatch based algorithm that starts searching before you even begin typing the search term. As soon as the find panel is open, it's already building a list of possible search results, and narrows the list down as you go. In the time it takes you to hammer out the third o in "foo" the find panel has already found 50,000 that do not contain "fo" so they obviously can't contain "foo" either, and will not be searched.
Search should be efficient
Instead of a complicated find panel with buttons everywhere, I just present a search box and a list of results, just like Spotlight. Use the up/down keys within the text field (or ctrl-p/ctrl-n) to select the result you want.
Hitting return doesn't initiate a search, because it's already finished searching by the time you get to that stage. Instead return closes the find panel and opens the search result.
So, basically, if I need to navigate to the
function fetchRelative() declaration, I just hit
[cmd-shift-f], type "n fetchR" followed by
Unfortunately my app is really only alpha quality, and while I use it daily it's
missing some pretty important features, one of which being the find panel just
opens the file, it doesn't take you to the part in the file with the search result.
Until that is fixed (pull requests are welcome!)
You'll need to use the file navigation functions for that (hit
NSPasteBoard makes sure both find operations have the same search string).
I'm also intimately familiar with pretty much every mac text editor out there. Sublime Text has a pretty good workflow for this, if you know the name of the file the function is declared in, you can use the "Open Anything" function.
For example if you know
fetchRelative() is declared in
you could type
doc#fer to jump right to it. I will probably implement this
feature in Dux one day... unless someone sends a pull request first. ;)
cmd-click on a word could bring up the find panel with that word typed