nvim-treesitter
tree-sitter
nvim-treesitter | tree-sitter | |
---|---|---|
310 | 72 | |
11,922 | 20,605 | |
2.4% | 2.8% | |
9.8 | 9.8 | |
1 day ago | 4 days ago | |
Tree-sitter Query | Rust | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
nvim-treesitter
-
Mastering Hot Reloading: Any Language, Any Editor
Then open the file in your favorite code editor, that is for me neovim btw, you might want to install a treesitter to provide some syntax highlighting although nice but not necessary, in vscode you can install a plugin for the syntax highlighting.
-
How to Setup Vim for Kotlin Development
Neovim could use the default regex based grammar that Vim uses for syntax highlighting. But I recommended installing treesitter. This uses a concrete syntax tree to provide more semantic meaning to tokens, allowing enriched (and faster) highlighting.
- Ask HN: Current best open-source or commercial automated LLM coding agent?
-
Lite ๐ ApolloNvim Distro 2024
๐ Tree-sitter plugin for code highlighting.
-
Neovim for beginners
Treesitter is what makes your neovim colorful. It uses the LSP and colorscheme and colors your variables, keywords and other stuff. To understand how treesitter works and configure treesitter please read the docs. Here is my configuration for treesitter:
-
Simple Neovim config
nvim-treesitter is a plugin that has been around for 4 years now. A lot of people will say this is essential to your Neovim experience, and I do agree to some extend. It is incredibly useful... as a dependency for other plugins. It allows Neovim to gather more information about source code of the current file, and plugin authors can do really cool things that. For "normal users" like you and me there are some modules we can enable. One of them can be used to enhance the syntax highlight of many programming languages. That I think the feature nvim-treesitter is known for.
- Bro Install Neovim On Windows And Setup Neovim Without Neovim Package Manager ๐
-
Leaving Neovim for Zed
I wouldn't really count those. Every editor with treesitter support will have those, it's for treesitter: https://github.com/nvim-treesitter/nvim-treesitter/blob/mast...
-
Customizing Your Lazyvim Setup for Personal Preferences
nvim-treesitter/nvim-treesitter (to provide a simple and easy way to use the interface for tree-sitter in Neovim and to provide some basic functionality such as highlighting based on it)
-
Ultimate Neovim Setup Guide: lazy.nvim Plugin Manager
nvim-treesitter/nvim-treesitter: Nvim Treesitter configurations and abstraction layer.
tree-sitter
-
Decoding Tree-sitter Playground Output For Fun
Paste this into the Playground (try it here). Youโll get something like:
-
Diving into Tree-Sitter: Parsing Code with Python Like a Pro
This code sets up a parser for Python code. The tree-sitter-python package provides a precompiled grammar, so no manual compilation is needed. If youโre targeting another language, check for its grammar package on Tree-Sitter Wiki.
-
Making Sense of tree-sitter's C API
The API is defined in tree_sitter/api.h (available on GitHub). It revolves around a few key concepts: parsers, trees, nodes, and queries. Letโs dive into the essentials.
-
Want AI to Actually Understand Your Code? This Tool Says It Can Help
Tree-sitter is a parser generator tool and an incremental parsing library, it is available in Rust ๐ฆ - GitHub. CocoIndex has built-in Rust integration with Tree-sitter to efficiently parse code and extract syntax trees for various programming languages.
-
Emacs Tree-sitter custom highlighting
I think the main problem is that highligthing framework used by tree-sitter (https://github.com/tree-sitter/tree-sitter/tree/master/highl...) is not easily pluggable into emacs font-lock-mode.
-
Highlighting Parts of Lua as Bash
Although I am not certain if tree-sitter allows matching on comments, but https://github.com/tree-sitter/tree-sitter/issues/1138 seems to imply that it does
-
I wrote my own "proper" programming language
Hard agree. Even without going deep on a "serious language" there's a universe of DSLs that's mostly unexplored.
Debuggers are the outlier in your group but there's not exactly a void for those other wishes. As just one slice, building a tree-sitter [1] grammar gives the basis for good editor integration [2], formatters [3], structural diff [4] and other dev tools. Similarly if you're expressing some form of program, mapping to LLVM IR connects your creation with a fairly extensive compiler toolchain.
Language agnostic tooling exists, but there still needs to be some abstraction layer.
[1]: https://tree-sitter.github.io/
[2]: https://zed.dev/blog/syntax-aware-editing
[3]: https://topiary.tweag.io
[4]: https://difftastic.wilfred.me.uk
-
Tbsp โ treesitter-based source processing language
For those that want to explore the grammars listed at https://github.com/tree-sitter/tree-sitter/wiki/List-of-pars... in a more friendly railroad diagram format I made https://mingodad.github.io/plgh/json2ebnf.html that reads the "src/grammar.json" and try it's best to generate an EBNF understood by (IPV6) https://www.bottlecaps.de/rr/ui or (IPV4) https://rr.red-dove.com/ui where we get a nice navigable railroad diagram (see https://github.com/GuntherRademacher/rr for offline usage).
-
Pragtical: The practical and pragmatic code editor
https://github.com/pragtical/plugins/commit/54096a6461f5c034... makes me long for The One Grammar To Rule Them โข
I thought for a while that TextMate bundles[1] were that, especially since JetBrains[2], Linguist[3] and VSCode[4] honor them. However, in the spirit of "the good thing about standards ..." highlight.js does[5] almost the same thing that Pragtical does which makes me feel even worse
I had high hopes for Tree-Sitter since it seems to have really won mindshare, but the idea of having an executable grammar spec[6] is ... well, no wonder it hasn't caught on outside of that specific ecosystem
1: https://github.com/rspec/rspec.tmbundle/blob/1.1.12/Syntaxes...
2: https://github.com/JetBrains/intellij-community/blob/idea/24...
3: https://github.com/github-linguist/linguist/blob/v7.30.0/lib...
4: https://github.com/microsoft/vscode-textmate
5: https://github.com/highlightjs/highlight.js/blob/11.10.0/src...
6: https://github.com/tree-sitter/tree-sitter/blob/v0.22.6/test...
-
Rust for Filesystems
If you like to see some examples of C bindings:
https://github.com/tree-sitter/tree-sitter/blob/25c718918084...
What are some alternatives?
coc.nvim - Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
PHP Parser - A PHP parser written in PHP
vim-polyglot - A solid language pack for Vim.
sourcegraph - Code AI platform with Code Search & Cody
packer.nvim - A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
language-server-protocol - Defines a common protocol for language servers.