Configuration
Treesitter is configured inlua/user/treesitter.lua.
Language Parsers
The configuration automatically installs and maintains parsers for:You can add more languages to the
ensure_installed list or use "all" to install all available parsers.Features
Syntax Highlighting
Treesitter provides context-aware syntax highlighting that understands code structure:Smart Indentation
Automatic indentation based on code structure:Auto-pairs Integration
Treesitter integrates with nvim-autopairs for context-aware bracket pairing:Context Commentstring
Intelligent comment detection based on language context:Installing Language Parsers
Manual Installation
Install a specific parser:Update Parsers
Update all installed parsers:View Installed Parsers
Supported Languages
Treesitter supports over 100 languages. Common ones include:- JavaScript/TypeScript
- Python
- Rust
- Go
- C/C++
- Java
- Ruby
- PHP
- HTML/CSS
- Markdown
- JSON/YAML
- And many more
Usage
Highlighting
Treesitter highlighting is automatic once parsers are installed. No additional configuration needed.Folding
Treesitter can be used for code folding:Troubleshooting
Highlighting Issues
If syntax highlighting isn’t working:- Check if the parser is installed:
:TSInstallInfo - Try reinstalling:
:TSInstall! <language> - Restart Neovim
Performance
For very large files, you may want to disable Treesitter:Benefits
- Accurate: Understands code structure, not just patterns
- Fast: Incremental parsing updates only changed parts
- Extensible: Foundation for other features like refactoring
- Consistent: Same highlighting across different file types

