tldr/pages/common/ctags.md

21 lines
758 B
Markdown
Raw Normal View History

2020-02-20 15:59:03 +00:00
# ctags
> Generates an index (or tag) file of language objects found in source files for many popular programming languages.
> More information: <https://ctags.io/>.
- Generate tags for a single file, and output them to a file named "tags" in the current directory, overwriting the file if it exists:
`ctags {{path/to/file}}`
- Generate tags for all files in the current directory, and output them to a specific file, overwriting the file if it exists:
`ctags -f {{path/to/file}} *`
2020-02-20 15:59:03 +00:00
- Generate tags for all files in the current directory and all subdirectories:
`ctags --recurse`
2022-09-26 13:44:09 +01:00
- Generate tags for a single file, and output them with start line number and end line number in JSON format:
`ctags --fields=+ne --output-format=json {{path/to/file}}`