HowTo Install all Tree-Sitter Parsers

Back home

1. EMACS - Install all Tree-Sitter Parsers

In order to use tree-sitter with emacs-29+ you will want to have all the parsers installed for all the new language modes included in emacs-29 and later. These can be installed one at a time by visiting each contributors github/gitlab or you can use this package to install most of them very easily.

This is made easy by github user casouri's package called tree-sitter-module: https://github.com/casouri/tree-sitter-module

git clone https://github.com/casouri/tree-sitter-module
cd tree-sitter-module
# DISCLAIMER: examine these scripts, and all repositories to make sure
# there's no malware
./batch.sh

Now you will have a "dist" folder containing the object files for each language parser.

% ls dist
libtree-sitter-bash.so	   libtree-sitter-dockerfile.so  libtree-sitter-java.so        libtree-sitter-perl.so	 libtree-sitter-tsx.so
libtree-sitter-c-sharp.so  libtree-sitter-elixir.so	 libtree-sitter-javascript.so  libtree-sitter-proto.so	 libtree-sitter-typescript.so
libtree-sitter-c.so	   libtree-sitter-glsl.so	 libtree-sitter-json.so        libtree-sitter-python.so  libtree-sitter-verilog.so
libtree-sitter-clojure.so  libtree-sitter-go-mod.so	 libtree-sitter-julia.so       libtree-sitter-ruby.so	 libtree-sitter-vhdl.so
libtree-sitter-cmake.so    libtree-sitter-go.so		 libtree-sitter-make.so        libtree-sitter-rust.so	 libtree-sitter-wgsl.so
libtree-sitter-cpp.so	   libtree-sitter-heex.so	 libtree-sitter-markdown.so    libtree-sitter-sql.so	 libtree-sitter-yaml.so
libtree-sitter-css.so	   libtree-sitter-html.so	 libtree-sitter-org.so	       libtree-sitter-toml.so

By default, on *nix systems, the default search patch for these is in your ~/.emacs/tree-sitter/ directory. So now we can just copy these into that directory and try it out.

mkdir -p ~/.emacs/tree-sitter
cp -a dist/* ~/.emacs/tree-sitter

Author: Dan Mack

Created: 2023-02-20 Mon 13:26

Validate