Changes: - Bind `F` to the function call text object - Add the text object to the table - Realign table so it looks right to people who don't hide emphasis markers
75 lines
2.6 KiB
Org Mode
75 lines
2.6 KiB
Org Mode
#+TITLE: tools/tree-sitter
|
|
#+DATE: August 17, 2021
|
|
#+SINCE: 3.0.0
|
|
#+STARTUP: inlineimages nofold
|
|
|
|
* Table of Contents :TOC_3:noexport:
|
|
- [[#description][Description]]
|
|
- [[#maintainers][Maintainers]]
|
|
- [[#module-flags][Module Flags]]
|
|
- [[#plugins][Plugins]]
|
|
- [[#hacks][Hacks]]
|
|
- [[#prerequisites][Prerequisites]]
|
|
- [[#features][Features]]
|
|
- [[#language-support][Language support]]
|
|
- [[#text-objects][Text Objects]]
|
|
- [[#configuration][Configuration]]
|
|
- [[#troubleshooting][Troubleshooting]]
|
|
|
|
* Description
|
|
This module adds [[https://tree-sitter.github.io/tree-sitter/][tree-sitter]] support to doom:
|
|
|
|
#+begin_quote
|
|
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.
|
|
#+end_quote
|
|
|
|
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
|
|
+ [[https://github.com/emacs-tree-sitter/elisp-tree-sitter][tree-sitter]]
|
|
+ [[https://github.com/emacs-tree-sitter/tree-sitter-langs][tree-sitter-langs]]
|
|
+ [[https://github.com/meain/evil-textobj-tree-sitter][evil-textobj-tree-sitter]]* (=:editor evil +everywhere=)
|
|
|
|
** TODO Hacks
|
|
# A list of internal modifications to included packages; omit if unneeded
|
|
|
|
* Prerequisites
|
|
This module has no prerequisites.
|
|
|
|
* Features
|
|
** Language support
|
|
Currently Emacs tree sitter has got [[https://github.com/emacs-tree-sitter/tree-sitter-langs/tree/master/repos][parsers for these languages]] with syntax
|
|
highlighting support for [[https://emacs-tree-sitter.github.io/syntax-highlighting/][these languages]].
|
|
|
|
** Text Objects
|
|
Not all language support all text objects (yet). [[https://github.com/nvim-treesitter/nvim-treesitter-textobjects#built-in-textobjects][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=)
|
|
|
|
* TODO Configuration
|
|
# How to configure this module, including common problems and how to address them.
|
|
|
|
* TODO Troubleshooting
|
|
# Common issues and their solution, or places to look for help.
|