Version 3 of Tags for Vi/ViM editing

Updated 2002-02-11 12:24:18

Pavel Hampl - I use ViM to edit my Tcl/Tk scripts. From my work with C-code I were used to work with tags which allowed me to jump quickly among different files and find procedure or function or class declaration. Unfortunately the program ctags recognizes only C, Fortran and similar languages. Therefore I have prepared one shell script and one awk script do create an equal 'tags' file which allows me to access proc definitions quickly. The main shell script finds all proc definitions in the directory:

 egrep -n '^[ \t]*proc[ ]+[a-zA-Z][a-zA-Z0-9]*[ ]+\{.+\}[ ]+\{[ ]*$'
 *tcl >tcltags
 awk -f tags.awk tcltags |sort >tags

The awk script which is called there transforms the grep output into a valid 'tags' file, which then has to be sorted. This is the awk script:

  {
   printf("%s",$2)
   split($1,a,":")
   printf("\t./%s\t%s;\"\tf\n",a[1],a[2])
   }                                                                     

Of course, all commands of the shell script can be connected into a piped single line. You then won't have to take care of the 'tcltags' file.

Now vim works fine for me it takes me less time to find the correct proc. Seems to me that these tags should be useful for EMACS users, too.