ctags(1) Universal Ctags ctags(1) (NAME) ctags - (tag) (SYNOPSIS) ctags [] [] etags [] [] (DESCRIPTION) ctags etags ( -e ) ( ctags ) ( "tag") () . ( ) . (tag) ( ). ctags (cross reference) . . ctags . ctags (kinds) . --list-languages --list-kinds-full . Universal Ctags ctags Exuberant Ctags . Universal Ctags Exuberant Ctags ctags-incompatibilities(7) . Exuberant Ctags (parser) . Universal Ctags . ctags-optlib(7) . . ctags . (COMMAND LINE INTERFACE) ctags ( "ctags *" "ctags -R") . . . ( -- [=(yes|no)] ) =yes ( --sort --sort=yes ). =1 =on =true =yes =0 =off =false =no . etags ( -e ) . . POSIX . . --list-languages . (Letters and names) ( --kinds-). . . Universal Ctags . . --kinds-C : --kinds-C=+pLl --kinds-C=+{prototype}{label}{local} --kinds-C=+{prototype}L{local} (shell) . . --list-... . (List options) Universal Ctags --list-... Universal Ctags ("Listing Options" ). . --with-list-header --machinable --list-... . (--with-list-header=yes --machinable=no) . . ('#') . --with-list-header=no --machinable=yes . . . . . (OPTIONS) ctags . (underscore) --_echo= . . : foo [ ... ] | ( ... ) . --foo[=(yes|no)] --foo --foo=yes --foo=no . / (Input/Output File Options) --exclude= . . ctags ( some/path/base.ext) ( base.ext) . C (shell wildcards) ( / regular expressions) ( ctags '/' ). --list-features wildcards . '@' . . --recurse . --list-excludes . --exclude-exception= . --exclude-exception= () . --exclude= . ctags foo foo/main.c : --exclude=foo/* --exclude-exception=foo/main.c. --filter[=(yes|no)] ctags . --sort . ( -L ) -L . -f -o --totals . . --filter-terminator= --filter . ctags . --recurse . . . --links[=(yes|no)] ( ) . . . --maxdepth= --recurse (-R) . --recurse[=(yes|no)] . -L ( '.') . ( --links ). find(1) "ctags -L -" (pipe) . --exclude --maxdepth . : . --help . -R --recurse . -L . '-' . . . . : ( ) . --append[=(yes|no)] . no . -a --append . -f ( "tags" etags "TAGS" ). '-' . ctags tagfile . "ctags -f *.c" C ! '-' ( ) . -ugly "-f ./-ugly" . . . -o "-f tagfile" . (Output Format Options) --format=(1|2) . 1 2 . 1 2 ( vi(1) ). 2 . [ etags ] --output-format=(u-ctags|e-ctags|etags|xref|json) . u-ctags . u-ctags e-ctags tags(5) . TAG_OUTPUT_MODE u-ctags e-ctags . ctags-client-tools(7) . etags -e xref -x . json ctags libjansson . json ctags-json-output(5) . --list-output-formats . -e --output-format=etags . etags Emacs . ctags "etags" ( ) etags . -x --output-format=xref . (xref) . : ( ) . . ( "ctags -x --kinds-c=f file") ( "ctags -x --kinds-c=v --extras=-F file"). --sort=(yes|no|foldcase) ( yes ). vi(1) . foldcase (case-folded) . case-folding readtags ctags 6.2 Vim ( "set ignorecase") . [ etags ] -u --sort=no ( "" unsorted). --etags-include= . . Emacs (includes) . [ etags ] --input-encoding= () . Universal Ctags --output-encoding=encoding . --input-encoding-= . --input-encoding . --output-encoding= () . Universal Ctags --input-encoding= . TAG_FILE_ENCODING . UTF-8 . (Language Selection and Mapping Options) --language-force=(|auto) ctags ( " " Determining file language ). language ( ) . auto ( ). --languages=[+|-](|all) ( ). '+' '-' ( / ctags ) . '-' . '+' '-' . . ( --langmap ). . --langdef . all . ( ) --list-languages . --languages= . --alias-=[+|-](|default) ('+') ('-') . ctags " " . . . default . all : --alias-all= . --alias-all=default . --guess-language-eagerly . " " . -G --guess-language-eagerly . --langmap=[,[...]] ( --list-maps ). ( ) / . ( .c). ( ([Mm]akefile)). C (wildcards) ( ctags ). --list-features wildcards . --langmap . ( --map- .) ('+') . .c .x C --langmap=c:.c.x .j Java --langmap=c:.c.x,java:+.j . makefile ( Makefile makefile .mak) make --langmap=make:([Mm]akefile).mak . ( '.' ..x .x.). ( ) ( --langmap=fortran:). default . --langmap=default . . Universal Ctags Exuberant Ctags . ctags-incompatibilities(7) . --map-=[+|-]| () --langmap . ctags () () ( N:1). --langmap 1:1 . N:1 C++ ObjectiveC .h . ( .c). ( ([Mm]akefile)). ('+') ('-') . . --langmap ( ) . --map- ( ) . . (Tags File Contents Options) (kinds) (roles) (extras) " (TAG ENTRIES)" . --excmd=(number|pattern|mix|combine) EX . [ etags ] ( ) : number . : 1. . 2. ( vim ). 3. ( " (BUGS)" ). 4. . (pattern) . : . . : -B -F. number Xref JSON . --_xformat="...%n" Xref --fields=+n-P JSON . pattern . . mixed . (Fortran) (common blocks) . Exuberant Ctags C . Universal Ctags C . ctags . combine . -n --excmd=number. -N --excmd=pattern. --extras=[+|-][|*] . " (Extras)" . (/ ) . '+' '-' . '*' . --extras= ( ) . Universal Ctags . ( " (Language-specific fields and extras)" ). --extras-= . --extras-(|all)=[+|-][|*] . Universal Ctags . " (Language-specific fields and extras)" . . all '*' . (--extras-all=) . . --list-extras= . --fields=[+|-][|*] . . " (TAG FILE FORMAT)" " (Extension fields)" . . '+' '-' . '+' '-' flags ( ). '*' . --format=1 ( ) . --fields-= . --fields-(|all)=[+|-][|*] . Universal Ctags . ( " (Language-specific fields and extras)" ). all '*' . ( --fields-all=) . . --fields=[+|-][|*] . --fields= . --kinds-(|all)=[+|-](|*) () ( ) ( --list-languages ). ( ) . --list-kinds-full . '+' '-' . '+' '-' kinds ( ). '*' . all kinds ctags . all '*' 'F' kinds . C (prototypes) --kinds-c=+px-d --kinds-c=f . C C++ ( ) . MASTER --list-kinds-full . --pattern-length-limit= . 0 ( 96 ). . ctags (minified) . UTF-8 . . UTF-8 . UTF-8 UTF-8 . . --pseudo-tags=[+|-](|*) / . '*' / . --put-field-prefix UCTAGS Universal Ctags . Universal Ctags . . Universal Ctags . . $ ctags --fields='{line}{end}' -o - hello.c main hello.c /^main(int argc, char **argv)$/;" f line:3 end:6 $ ctags --put-field-prefix --fields='{line}{end}' -o - hello.c main hello.c /^main(int argc, char **argv)$/;" f line:3 UCTAGSend:6 end Universal Ctags . --roles-(|all).(|*)=[+|-][|*] . . . ( {system} "system"). --kinds- '+' '-' . '*' . . ( --roles-C.h=+{system}{local} --roles-C.{header}=+{system}{local}). '*' / / ( --roles-C.*=* --roles-C.*=). all / / ( --roles-all.*=* --roles-all.*=). --tag-relative=(yes|no|always|never) . etags ( -e ) yes no . yes . no . always . never . --use-slash-as-filename-separator[=(yes|no)] input: ('/') ('\') . "u-ctags" yes no . TAG_OUTPUT_FILESEP . ctags-client-tools(7) . MS Windows . -B ( ?pattern?). [ etags ] -F ( /pattern/) (). [ etags ] (Option File Options) --options= . ctags optlib . ctags . . .ctags . --options=NONE ("FILES" ). --options-maybe= --options ( ) . --optlib-dir=[+] optlib optlib . optlib "Default optlib path list" . optlib (optlib Options) ctags-optlib(7) . --kinddef-=,, (kind) . --kinds- . --langdef= . --mline-regex-=////[] . --regex-=////[] . (Language Specific Options) --if0[=(yes|no)] "#if 0" ( ). no () . "#if 0" (fall-back) . --line-directives[=(yes|no)] #line . () . . ctags () . ( #line ). : --excmd=number (-n) . ctags --langmap --language-force . -D = C . gcc . . (stringification) (token pasting) . -I . -h (|default) include ( ) . ( '.' ..x .x.). (scoping) ( ) . include ( ) ( static) . include . '+' . fileScope/F --extras . .h.H.hh.hpp.hxx.h++.inc.def . "-h default" . ( "Determining file language" ) --map- --langmap --language-force . -I C C++ . . . '+' ( "-I FOO+") ctags . "-I MODULE_VERSION+" . '=' ( -I FOO=BAR) . . "-I CLASS=class" . '@' '.' ('/' '\') ( C:) . ( ) ( ). -I . ('-') . . ( "CAVEATS" ). . int foo ARGDECL4(void *, ptr, long int, nbytes) ARGDECL4 foo . "-I ARGDECL4" . /* creates an RCS version string in module */ MODULE_VERSION("$Revision$") ( K&R ). . "-I MODULE_VERSION+" . CLASS Example { // your content here }; CLASS . CLASS Win32 class __declspec(dllexport) UNIX class . C++ class . "-I CLASS=class" . --param-.= . --list-params . (Listing Options) --list-aliases[=(|all)] (aliases) all () . all . . --list-excludes . --list-extras[=(|NONE|all)] (extras) all () . NONE . "Extras" . all . --extras= --extras-= . . : LETTER . '-' . NAME (long-name). extras . ENABLED . yes no . LANGUAGE . NONE . DESCRIPTION . --list-features . --list-fields[=(|NONE|all)] all () . NONE . "Extension fields" . all . : LETTER . '-' . NAME . ENABLED . yes no . LANGUAGE . NONE . JSTYPE JSON --output-format=json . ctags-client-tools(7) . FIXED tags . tags . yes . tag JSON . OP optscript. Universal Ctags . DESCRIPTION . --list-kinds[=(|all)] --list-kinds-full . Exuberant Ctags . LETTER DESCRIPTION ENABLED --list-kinds-full . ENABLED --list-kinds-full (kind) [off] . . . Universal Ctags --list-kinds-full . --machinable --with-list-header . --list-kinds-full[=(|all)] (tag kinds) all () . "Kinds" . all . . --kinds- . : LANGUAGE . LETTER . . NAME . . K --fields=+K ctags . / --kinds- . "Letters and names" . . ENABLED . yes no . REFONLY . yes . "TAG ENTRIES" . NROLES . "Roles" . MASTER (master parser) . Universal Ctags () / . . Exuberant Ctags C ++C . / kindX C / ++C . Universal Ctags master parser . / . $ ctags --kinds-C=+'{local}' --list-kinds-full \ | grep -E '^(#|C\+\+ .* local)' #LANGUAGE LETTER NAME ENABLED REFONLY NROLES MASTER DESCRIPTION C++ l local yes no 0 C local variables $ ctags --kinds-C=-'{local}' --list-kinds-full \ | grep -E '^(#|C\+\+ .* local)' #LANGUAGE LETTER NAME ENABLED REFONLY NROLES MASTER DESCRIPTION C++ l local no no 0 C local variables ENABLED local ++C local C / . . DESCRIPTION . --list-languages ctags . --language-force --languages --kinds- --regex- . [disabled] . --languages=+ . --machinable --with-list-header . --list-map-extensions[=(|all)] all () . all . --list-map-patterns[=(|all)] all () . all . --list-maps[=(|all)] all () . all . --list-map-extensions --list-map-patterns . --langmap "Determining file language" ( ) . --machinable --with-list-header . --list-mline-regex-flags . ctags-optlib(7) . --list-output-formats --output-format . NULLTAG null tags ( ) . nulltag/z "Extras" . ( 6.2.0 ) --list-params[=(|all)] all () . all . --list-pseudo-tags . --list-regex-flags --regex- . ctags-optlib(7) . --list-roles[=(|all)[.(|*)]] all () . all . all '.' (kinds) . . : LANGUAGE . KIND(L/N) . NAME . ENABLED . yes no . DESCRIPTION . --list-subparsers[=(|all)] all () . all . --machinable[=(yes|no)] --list- . . "List options" . . --with-list-header[=(yes|no)] --list- . "List options" . (Miscellaneous Options) --help . -? --help. --help-full . . --license . --print-language . --quiet[=(yes|no)] ( no ). --totals[=(yes|no|extra)] ctags . no . extra . --verbose[=(yes|no)] (verbose) . ctags . ctags ( "FILES" ) . . no . -V --verbose. --version[=|NONE] ctags . "Universal Ctags" . TAG_PROGRAM_VERSION TAG_OUTPUT_VERSION ctags-client-tools(7) . NONE . . TAG_PARSER_VERSION ctags-client-tools(7) . (Obsoleted Options) Exuberant Ctags . -w ctags SVR4 Unix . --file-scope[=(yes|no)] . --extras=[+|-]F --extras=[+|-]{fileScope} . --extra=[+|-][|*] --extras=[+|-][|*] --kinds-= --fields= . ---kinds=[+|-](|*) . --kinds-=... . (OPERATIONAL DETAILS) ctags " " (Determining file language) . . . " " (TAG FILE FORMAT) . C/C++ (Notes for C/C++ Parser) ctags C . ctags . ctags . ctags ( #if 0 ). : #ifdef TWO_ALTERNATIVES struct { #else union { #endif short a; long b; } ctags . ( ) ctags #if ('}') . ctags : extern void foo __ARGS((int one, char two)); '((' . ++C . ( ) "operator " ( "operator<<" ). . (Determining file language) (File name mapping) --language-force . --list-maps --langmap --map- . ctags . . ctags ( "ctags *") ( "ctags -R") . . .h C++ C ObjectiveC . . ctags . --language-force= --langmap=[,[...]] --map-=[+|-]| . ( --guess-language-eagerly .) (Heuristically guessing) ctags : (template file name testing) .in ctags . config.h.in config.h . "" ("interpreter" testing) #! . ctags . ctags . #!/bin/sh . ctags "shell" "sh" . sh shell ctags "shell" . env . env ( "#!/usr/bin/env python") ctags . --list-aliases . --alias-=+ --alias-=- . " zsh" ("zsh autoload tag" testing) #compdef #autoload ctags "zsh" . " emacs " ("emacs mode at the first line" testing) Emacs . Emacs modeline . Emacs . ctags MODE "" : -*- mode: MODE -*- -*- MODE -*- " emacs " ("emacs mode at the EOF" testing) Emacs . Emacs . ctags MODE "" : Local Variables: ... mode: MODE ... End: . "modeline vim" ("vim modeline" testing) modeline Emacs Vim . ctags TYPE "" : filetype=TYPE ft=TYPE " PHP" ("PHP marker" testing) ctags "php" . . ctags . "interpreter" --guess-language-eagerly ( -G) . -G . --print-language . : $ ctags --print-language config.h.in input.m input.unknown config.h.in: C++ input.m: MatLab input.unknown: NONE NONE ctags . (TAG FILE FORMAT) . tags(5) ctags-client-tools(7) . etags (regular tags) : ;" : 1. : 2. : 3. : 4. : 5. : EX ( /pattern/ ?pattern?) ( --excmd= ). 6. ;": . "Extension fields" . ( --format ) EX EX EX vi(1) . (pseudo tags) . !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ ... --pseudo-tags=[+|-](|*) . "ctags --list-pseudo-tags" . tags(5) ctags-client-tools(7) . . (magic number) . . . --tag-relative=(yes|no|always|never) . (TAG ENTRIES) . Exuberant Ctags Universal Ctags . (definition tags) (reference tags) . Exuberant Ctags : . Universal Ctags : . . (Extension fields) (extension fields) . - / EX . - key:value . (scope) . . C struct:myStruct . --fields=[+|-][|*] --fields-(|all)=[+|-][|*] . "ctags --list-fields" . name input pattern line. ( / ): access/a . end/e . extras/E . "Extras" . file/f . . . implementation/m ( ) (virtual pure virtual ++C abstract Java). inherits/i ( ). input/F name . k . . . kind/z . K . . kind/z . kind/z kind: kind . k K . language/l . line/n name input . name/N . nth/o . ( ). pattern/P name input . roles/r . "Roles" . s . . . scope/Z . scope/Z scope: (s) . s . scopeKind/p (long-name). signature/S ( ) . . C . typeref/t typedef typeref:. . (Kinds) kind . . C macro function variable typedef . --kinds-(|all)=[+|-](|*) ( ) . "ctags --list-kinds-full" . . (key) ( ) . --fields . $ ctags -o - kinds.c foo kinds.c /^int foo() {$/;" f typeref:typename:int $ ctags --fields=+k -o - kinds.c foo kinds.c /^int foo() {$/;" f typeref:typename:int $ ctags --fields=+K -o - kinds.c foo kinds.c /^int foo() {$/;" function typeref:typename:int $ ctags --fields=+z -o - kinds.c foo kinds.c /^int foo() {$/;" kind:f typeref:typename:int $ ctags --fields=+zK -o - kinds.c foo kinds.c /^int foo() {$/;" kind:function typeref:typename:int (Roles) Role () Universal Ctags . . " (Kinds)" kind . header C++ package Java package. roles . kind roles . . def . Baz package imported . package Bar; import Baz; class Foo { // ... } $ ctags --fields=+KEr -uo - roles.java Bar roles.java /^package Bar;$/;" package roles:def Foo roles.java /^class Foo {$/;" class roles:def $ ctags --fields=+EKr --extras=+r -uo - roles.java Bar roles.java /^package Bar;$/;" package roles:def Baz roles.java /^import Baz;$/;" package roles:imported extras:reference Foo roles.java /^class Foo {$/;" class roles:def --roles-(|all).(|all)=[+|-][|*] . "ctags --list-roles" . (Extras) ctags . name: name: . extra (extra) . qualified (scope- qualified) . --extras-(|all)=[+|-][|*] . ctags --list-extras . ( / ): anonymous/none . . . struct { double x, y; } p = { .x = 0.0, .y = 0.0 }; 'x' 'y' . ctags 'x' 'y' . ctags (anonymous) . $ ctags --fields=-f -uo - input.c __anon9f26d2460108 input.c /^struct {$/;" s x input.c /^ double x, y;$/;" m struct:__anon9f26d2460108 y input.c /^ double x, y;$/;" m struct:__anon9f26d2460108 p input.c /^} p = { .x = 0.0, .y = 0.0 };$/;" v typeref:struct:__anon9f26d2460108 __anon9f26d2460108 . typeref 'p' . fileScope/F ( static C) . -h . . --extras=-F . --file-scope Exuberant Ctags . static int f() { return 0; } int g() { return 0; } $ ctags -uo - filescope.c f filescope.c /^static int f() {$/;" f typeref:typename:int file: g filescope.c /^int g() {$/;" f typeref:typename:int $ ctags --extras=-F -uo - filescope.c g filescope.c /^int g() {$/;" f typeref:typename:int inputFile/f ( example.c) . --file-tags Exuberant Ctags . end: . ( ctags end: .) ctags inputFile/f . Unknown --languages=+Unknown ctags . etags Unknown . nulltag/z ( null tags) . (parser bug) . ctags . --quiet . . JavaScript {"": val} . ( ) ctags . . nulltag/z ctags . . --list-output-formats . ( 6.2.0) pseudo/p (pseudo-tags). . ctags-client-tools(7) . qualified/q (class-qualified) (namespace-qualified) . . . ( ). C++ Perl class::member Eiffel Java class.member . : PHP (backslash) . Universal Ctags (escaped). tags(5) . qualified . class point { double x; }; ctags point x . qualified (--extras=+q) point.x "point.x" . $ ctags --fields=+K -uo - qualified.java point qualified.java /^class point {$/;" class x qualified.java /^ double x;$/;" field class:point $ ctags --fields=+K --extras=+q -uo - qualified.java point qualified.java /^class point {$/;" class x qualified.java /^ double x;$/;" field class:point point.x qualified.java /^ double x;$/;" field class:point reference/r (reference tags). " (TAG ENTRIES)" . reference . #include #include "utils.h" #define X #undef X roles:system roles:local '<' . "#define X" . "#undef X" . $ ctags --fields=+EKr -uo - inc.c X inc.c /^#define X$/;" macro file: roles:def extras:fileScope $ ctags --fields=+EKr --extras=+r -uo - inc.c stdio.h inc.c /^#include /;" header roles:system extras:reference utils.h inc.c /^#include "utils.h"/;" header roles:local extras:reference X inc.c /^#define X$/;" macro file: roles:def extras:fileScope X inc.c /^#undef X$/;" macro file: roles:undef extras:fileScope,reference (Language-specific fields and extras) Exuberant Ctags (fields) (extras) . . Universal Ctags . VI (HOW TO USE WITH VI) vi(1) tags . : vi -t tag vi tag . :ta tag . Ctrl-] . Ctrl-T ( ). GNU EMACS (HOW TO USE WITH GNU EMACS) emacs(1) TAGS . : M-x visit-tags-table FILE FILE . M-. [TAG] TAG. . M-* M-. . C-u M-. . Tags info Emacs . NEDIT (HOW TO USE WITH NEDIT) NEdit 5.1 ( --format ). o NEdit "File->Load Tags File" . o (highlight) Ctrl-D . NEdit 5.1 . X nedit.tagFile NEdit . (CAVEATS) ctags ctags . ctags . C ctags . -I . ctags ( --excmd ) . : int variable; /* ... */ void foo(variable) int variable; { /* ... */ } ( ) . --excmd=n . (INCOMPATIBLE CHANGES) Universal Ctags Exuberant Ctags ctags-incompatibilities(7) . Universal Ctags . (kind Letter) unknown unknown . EmacsLisp u . Go u . Julian x . Lisp u . Lua X Python x . 5.9.x Y . (BUGS) ctags ls(1) . ctags . ctags . << >> (GIGO) . C++ ( className::function) ctags (scope specifier) namespace scope . C++ ( ) ( public protected private) ( virtual pure virtual) . ( --kinds-c++=+p) . (qualified tags) . (ENVIRONMENT VARIABLES) TMPDIR mkstemp(3) . ( ) . ctags () emacs () () sort(1) . sort(1) . ctags setuid TMPDIR . (FILES) (Output files) tags ctags. TAGS etags. (Preloading option files) $XDG_CONFIG_HOME/ctags/*.ctags $HOME/.config/ctags/*.ctags $XDG_CONFIG_HOME $HOME/.ctags.d/*.ctags $HOMEDRIVE$HOMEPATH/ctags.d/*.ctags ( MS Windows) .ctags.d/*.ctags ctags.d/*.ctags ctags . . ctags --version custom-conf . (override ). . ( ) . ( ). . '#' . *.ctags . optlib (Default optlib path list) $XDG_CONFIG_HOME/ctags $HOME/.config/ctags $XDG_CONFIG_HOME $HOME/.ctags.d $HOMEDRIVE$HOMEPATH/ctags.d ( MS Windows) optlib . optlib "Option File Options" . optlib .ctags . --options= . . $HOME/.ctags.d/linux $HOME/.ctags.d/linux/my.ctags . $HOME/.ctags.d/linux/device-driver.ctags $HOME/.ctags.d/linux/network-stack.ctags . () .ctags --options=linux ctags . (SEE ALSO) ( ) ctags-optlib(7) . tags(5) . Exuberant Ctags ctags-incompatibilities(7) . ctags-client-tools(7) . ctags-lang-python(7) . readtags(1) . Universal Ctags : ex(1) vi(1) elvis(1) vim(1) ctags. vim(1) Vim : TAGS emacs : . (AUTHOR) Universal Ctags Darren Hiebert <> (MOTIVATION) " ." " ." -- (CREDITS) ctags (Universal Ctags) fishman-ctags Reza Jelveh ( ) . fishman-ctags Exuberant Ctags . tagmanager Geany () . Exuberant Ctags ctags Steve Kirkendall <> Elvis vi ( ). Bram Moolenaar <> vim . "HOW TO USE WITH GNU EMACS" info GNU etags . 6.2.1 ctags(1)