next up previous contents
Next: Example of Fortran tag Up: Guide to VI and Previous: Escaping to UNIX Shell

Tag Files for Multiple Programs

vi includes a tag file capability that, when used in synergy with ctags (see ctags(1) for more), simplifies random editing of code segments in large programs. Functionality is provided only for Fortran, Pascal and C codes. ctags reads the specified files and creates the tag file with file name tags. File tags describes the routine dependencies and is used by vi to move around source code files using matching criteria stated by file tags.


Creating Tag Files
ctags prog* create tag file for all prog* source code
ctags *io*.c create tag file for all *io*.c files
ctags *.c create tag file for all C files
ctags *.f create tag file for all Fortran files
ctags *.[fc] create tag file for all C/Fortran files


Note that vi cannot handle variable names for the tag file, therefore it is advisable to create a dedicated directory for each program on which editing should use vi tagging facility. vi searches file tags when called with the -t option. tags is the default name of ctags output.



 
next up previous contents
Next: Example of Fortran tag Up: Guide to VI and Previous: Escaping to UNIX Shell
Marisa Luvisetto
2000-12-20