# Universal Ctags — Maintained Code Navigation and Indexing Tool > A maintained fork of Exuberant Ctags that generates tag files for code navigation across 200+ programming languages. ## Install Save in your project root: # Universal Ctags — Maintained Code Navigation and Indexing Tool ## Quick Use ```bash # Install on macOS brew install universal-ctags # Install on Ubuntu/Debian sudo apt install universal-ctags # Generate tags for a project ctags -R --languages=Python,JavaScript . ``` ## Introduction Universal Ctags is the actively maintained successor to Exuberant Ctags. It scans source code files and generates index files (tags files) that editors like Vim, Emacs, and VS Code use for jump-to-definition, symbol search, and code navigation across over 200 programming languages. ## What Universal Ctags Does - Parses source code in 200+ languages to extract function, class, variable, and type definitions - Generates tags files compatible with Vim, Emacs, and other editors for jump-to-definition - Supports optlib, a DSL for defining new language parsers without modifying the C source - Produces JSON output for integration with external tools and language servers - Handles multi-language files and embedded code blocks correctly ## Architecture Overview Universal Ctags is written in C for maximum performance. It uses a modular parser architecture where each language has a dedicated parser (either built-in C code or user-defined optlib patterns). The main loop reads source files, dispatches to the appropriate parser, extracts tag entries, and writes them to the output tags file. The project follows a strict backward-compatibility policy with Exuberant Ctags while adding new features. ## Self-Hosting & Configuration - Install via system package managers on all major Linux distributions and macOS - Build from source with Autotools for custom builds or embedded use - Configure per-project with a `.ctags` file for custom language mappings and exclusions - Use `--exclude` patterns to skip generated code, vendor directories, or build artifacts - Integrate with editor plugins like Gutentags (Vim) for automatic tag regeneration ## Key Features - Supports 200+ languages out of the box with active additions for modern languages - Optlib DSL allows users to define custom parsers using regex patterns - Xref and JSON output modes for tool integration beyond traditional tags files - Interactive mode for incremental parsing in editor plugins - Fully backward-compatible with Exuberant Ctags tags format ## Comparison with Similar Tools - **Exuberant Ctags** — the predecessor, no longer maintained since 2009; Universal Ctags is the active fork - **Tree-sitter** — AST-based parsing for editors; ctags is focused on tag generation - **LSP servers** — provide richer semantic analysis; ctags is faster and works without a running server - **cscope** — C-focused cross-reference tool; ctags is multi-language - **GNU Global (gtags)** — similar tag generation with built-in search; ctags is more widely supported by editors ## FAQ **Q: How is Universal Ctags different from Exuberant Ctags?** A: Universal Ctags is the maintained fork with new language support, bug fixes, and features like JSON output and optlib. **Q: Which editors support ctags?** A: Vim, Neovim, Emacs, Sublime Text, VS Code (with extensions), and many others read tags files. **Q: Can I add support for a custom language?** A: Yes. Use the optlib feature to define parsers with regex patterns in a configuration file. **Q: Does it replace a language server (LSP)?** A: Not entirely. LSP provides richer features like rename and diagnostics. Ctags excels at fast, offline symbol indexing. ## Sources - https://github.com/universal-ctags/ctags - https://ctags.io --- Source: https://tokrepo.com/en/workflows/asset-b6d574bc Author: AI Open Source