Syntax ctags etags Optionsĭespite the wealth of available options, defaults are set so that ctags is most commonly executed without any options (e.g., " ctags *", or " ctags -R"), which creates a tag file in the current directory for all recognized source files. h extensions in C++, and no harm results in treating them as C++ files. h extensions are mapped to C++ files rather than C files is because it is common to use. This permits running ctags on all files in either a single directory (e.g., " ctags *"), or on all files in an entire source directory tree (e.g., " ctags -R"), since only those files whose names are mapped to languages are scanned. On platforms which support it, if the name of a file is not mapped to a language and the file is executable, the first line of the file is checked to see if the file is a " #!" script for a recognized language.īy default, all other file names are ignored. The mappings in effect for each language may be display using the -list-maps option and may be changed using the -langmap option. Unless the -language-force option is specified, the language of each source file is automatically selected based upon a mapping of file names to languages. For a complete list of supported languages, the names by which they are recognized, and the kinds of tags that are generated for each, see the -list-languages and -list-kinds options. vi and its derivatives (e.g., Elvis, Vim, Vile, Lemmy)Ĭtags is capable of generating different kinds of tags for each of many different languages.Tag index files are supported by numerous editors, which allow the user to locate the object associated with a name appearing in a source file and jump to the file and line which defines the name. A "tag" signifies a language object for which an index entry is available (or the index entry created for that object).Īlternatively, ctags can generate a cross reference file which lists, in human-readable form, information about the various source objects found in a set of language files. This tag file allows these items to be quickly and easily located by a text editor or other utility. The ctags and etags programs (hereafter collectively referred to as ctags, except where distinguished) generate an index (or "tag") file for a variety of language objects found in the specified file(s).