Skip to content

Latest commit

 

History

History
61 lines (38 loc) · 1.67 KB

ztags.1.scd

File metadata and controls

61 lines (38 loc) · 1.67 KB

ztags(1)

NAME

ztags - generate tags files from Zig source code

SYNOPSIS

ztags [-a] [-r] [-o OUTPUT] FILES...

DESCRIPTION

ztags is a replacement for the ctags(1) tool specifically for working with Zig source code. Unlike ctags(1), ztags does not use regex based matching but instead parses the abstract syntax tree of the provided Zig sources. This results in fewer false positives and better matching.

Import statements of the form @import("foo.zig") are followed and parsed. Only imports using relative file paths are followed: import statements of the form @import("foo") are not followed because ztags does not have enough information at runtime to determine the source file location of the foo package.

The following options are available:

-a Append tags to an existing tags file instead of overwriting. Duplicate tags are removed.

-r Use paths relative to the current working directory in the generated tags file. This is equivalent to --tag-relative=no in ctags(1).

-o OUTPUT Write tags to OUTPUT (default is tags in the current directory).

EXAMPLES

Generate tags for the Zig standard library

Run ztags on std.zig in Zig's installation directory. Example:

ztags -o ~/.cache/tags/zig.tags /usr/local/lib/zig/lib/std.zig

This will generate a separate tags file just for standard library tags. Alternatively, analyze the standard library alongside your project source code and include all tags in the same file:

ztags src/main.zig /usr/local/lib/zig/lib/std.zig

SEE ALSO

ctags(1)

CONTRIBUTE

Report bugs and send patches to the mailing list ~gpanders/ztags@lists.sr.ht.

AUTHOR

Gregory Anders greg@gpanders.com