Bill Jonas on Sun, 9 Dec 2001 17:10:16 +0100 |
I'll second the enthusiasm for {e,c}tags! At my previous job, my duties were maintaining and adding functionality to a customer's web site, which was written in Perl. This particular Perl was OO Perl, but it was horribly complex. One of the first things I did to get more familiar with Perl and with the codebase when I was initially dispatched to the client's site was to write a (reasonably generic) documentation auto-generator for a hierarchy of Perl modules (http://www.billjonas.com/code/ for a description, http://www.billjonas.com/code/perldoc.tar.gz for the tarball if you're interested). I found myself referring to the output of lineage (my program) quite often as I tried to figure out exactly what steps were being taken by the application. Finally, one day I said, "To hell with this, I'm going to learn how to use ctags." Best thing I ever did! Now I was just two keystrokes away from the definition of a function and two to go back to exactly where I was, line and column. On Sat, Dec 08, 2001 at 10:42:54PM +0100, Jeff Abrahamson wrote: > Members of the church of vi, see ctags. Use from within vi is left > as an exercise. I used Exuberant Ctags, which is (or was, at least in 5.x) distributed with Vim. Vim looks for a file called "tags" in the current directory when you try to invoke a tag function. If you want to jump to the definition of a function, position the cursor over the name of the function (some vi clones or Vi itself might require you to have the cursor at the beginning of the word) and hit Ctrl-]. To go back to where you were, hit Ctrl-T. (Yes, Ctrl-] conflicts with the telnet escape character, but you should be using ssh anyway. <g>) ":help tags" for more information. The sixth edition of the O'Reilly vi book has a section on the more popular vi clones (vim, elvis, nvi, and vile) and it covers their methods for tags operations. I've gotta say, it's almost amazing to hit Ctrl-] and be taken to the function definition in a totally different file. On Sun, 09 Dec 2001 09:56:44 -0500, Leonard Rosenthol wrote: > Always makes me wonder why people continue to use stone knives... Stone knives and bearskins, indeed. <g> -- Bill Jonas * bill@billjonas.com * http://www.billjonas.com/ Developer/SysAdmin for hire! See http://www.billjonas.com/resume.html Attachment:
pgpKQwYgVdk3J.pgp
|
|