| Crates.io | treetags |
| lib.rs | treetags |
| version | 0.2.2 |
| created_at | 2025-03-27 12:41:41.096627+00 |
| updated_at | 2025-09-01 07:03:08.370668+00 |
| description | Generate vi compatible tags for multiple languages |
| homepage | |
| repository | https://github.com/jha-naman/treetags |
| max_upload_size | |
| id | 1607895 |
| size | 210,843 |
Generate vi compatible tags for multiple languages.
Uses the tags queries defined in the various official language parsers to detect tags.
The goal is to have code navigation available in vim/nvim for multiple languages with minimum effort and have reasonable performance. Extension Fields support is missing by design for most languages to make it easier to support multiple languages and keep the program trivially easy to maintain.
Refer to this issue to see how tags compare to LSP.
By default, it will generate a new tag file in the current directory and look
for tags recursively in the current directory and its children.
If the --append option is used, it will look for a tag file in the current
directory or any of its parent directories, and update the tag file if it exists
with tags generated from the list of files passed via command line.
Install Rust and C developmet toolchains to build treetags
cargo build --release
cp target/release/treetags /somewhere/in/the/PATH/
While it is fine to manually invoke treetags to generate tags file for a project,
the recommended way is to use the gutentags
plugin to manage the tags file. There is a nice write-up on setting up gutentags
here,
which can be useful for setting things up.
You will have to configure gutentags to use treetags as the tags generator at
a minimum in your vim/nvim configuration file.
let g:gutentags_ctags_executable = 'treetags'
Or, if you are using lua for configuration
vim.g.gutentags_ctags_executable = 'treetags'
Integration tests are built from test cases on demand
cargo build # Generates test files
cargo test # Runs all tests including generated ones
Use the --help option to see supported command line arguments.
$ target/release/treetags --help
Generate vi compatible tags for multiple languages
Usage: treetags [OPTIONS] [FILE_NAMES]...
Arguments:
[FILE_NAMES]... List of file names to be processed when `--append` option is passed
Options:
... # Options omitted for brevity