How to use a local tree sitter grammar in a new major mode I'm working on

I’m new to emacs and doom emacs. And I want to create a new major mode for a language with tree-sitter. I am working on the tree-sitter parser locally and It’s working (tested in neovim and helix)

Now I want to tell emacs to use the grammar to do syntax highlighting and eventually use in text objects.

How do I do that? Here is the current major mode code

(define-derived-mode imba-mode fundamental-mode "imba"
  "major mode for editing imba language code."
  (add-hook 'imba-mode-hook #'tree-sitter-hl-mode))
1 Like

This isn’t really doom specific. The general emacs details are here: emacs/starter-guide at a8732cb07aa3d707fd1a5271b1d6645ca3c84c3c · emacs-mirror/emacs · GitHub

This topic was automatically closed after 360 days. New replies are no longer allowed.