doomemacs/modules/tools/tree-sitter
Jeetaditya Chatterjee 6508579595
docs(tree-sitter): add docs for disabling text-obj
for certain modes, this also removes the hacks section as it was not
needed
2022-05-22 21:26:03 +01:00
..
config.el fix(tree-sitter): properly gatekeep ts text objs 2022-05-22 21:26:03 +01:00
doctor.el docs(tree-sitter): add doctor check for modules 2022-05-22 21:25:58 +01:00
packages.el bump: :tools tree-sitter 2022-05-22 21:26:03 +01:00
README.org docs(tree-sitter): add docs for disabling text-obj 2022-05-22 21:26:03 +01:00

tools/tree-sitter

Description

This module adds tree-sitter support to doom:

Tree sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited.

It includes:

  • Better syntax highlighting of supported languages
  • Structural text objects to manipulate functions statements and other code structures like any other text object

Maintainers

  • @jeetelongname

Module Flags

This module provides no flags.

Plugins

Prerequisites

This module has no prerequisites.

Features

Language support

Currently Emacs tree sitter has got parsers for these languages with syntax highlighting support for these languages.

Text Objects

Not all language support all text objects (yet). Here is a table of the text objects languages support Note: only languages with parsers in emacs have text object support currently. Currently text objects are bound to:

key text object
f function definition
F function call
C class
c comment
i conditional
l loop

They are used in a container context (not vf but vaf or vif)

Configuration

Disable text objects for certain modes

If you wish to disable tree sitter text objects then you can just remove +tree-sitter-keys-mode from the language mode hook, for example if we did not want it for ruby we would use this snippet

(remove-hook! 'ruby-mode-hook #'+tree-sitter-keys-mode)

TODO Troubleshooting