Magically Format Embedded Languages In Neovim - TJ DeVries (17min)

TL;DR

Very good video about how to use tree-sitter to find and manipulate text in Neovim.

Pretty sure this shows me just about everything I know in order to make executable code blocks in Neovim.

Notes
  • Introduces :TSPlaygroundToggle

  • Pressing "o" in TSPlayground opens a live query editor

  • The queries are written in scheme

  • The external tools just need to read from stdin and write to stdout in order to work with the lua process that gets set up

  • Goes over a ton of details about how to set things up. I'll do write ups of that stuff as I work through the process

  • At the end shows how to use the treesitter queries to do injections. You don't need to do that in a parser, you can make injetions using the same queries in your config under (e.g.) `queries/rust/injections.scm``

Code
fn main() {
  println!("here)";
}
Code
print("asdf")

Reference

Reference

Reference