| Crates.io | treetags |
| lib.rs | treetags |
| version | 0.5.2 |
| created_at | 2025-03-27 12:41:41.096627+00 |
| updated_at | 2025-12-04 13:29:00.281099+00 |
| description | Generate vi compatible tags for multiple languages |
| homepage | |
| repository | https://github.com/jha-naman/treetags |
| max_upload_size | |
| id | 1607895 |
| size | 308,324 |
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 in files list passed during command line invokation. By default it
recursively traverses directories present in the list. Pass the -R no
or --recurse no options do not want directories to be recursively looked
into for tags.
If the --append option is used it will update the existing tag file
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'
Users can generate completions like:
# refer to your shell documentation for determining the correct path for autcomplete files
treetags completions bash > ~/.local/share/bash-completion/completions/treetags
treetags completions zsh > ~/.local/share/zsh/site-functions/_treetags
treetags completions fish > ~/.config/fish/completions/treetags.fish
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