tree-sitter server for kakoune

Overview

tree-sitter.kak

Warning This currently just a proof-of-concept, and isn't stable yet.

A Tree-sitter server that keeps parsed ASTs in memory. This is useful for generalizing plugins that want to query the AST. Highlighting and structural selections are two main motivating examples.

Highlighting Demo

asciicast

Usage

The package does not install a configuration file automatically. So you must put one wherever you like and tell the plugin where that configuration file is:

set-option global tree_sitter_config <path_to_your_config>

Then, in buffers where you want to use tree-sitter.kak, call tree-sitter-enable-buffer. Furthermore, if you want to enable highlighting, you should remove the default highlighters. For example, for rust:

hook buffer BufSetOption filetype=rust %{
  tree-sitter-enable-buffer
  rmhl window/rust
}

Configuration

The configuration file currently only controls highlights, and maps tree-sitter captures to kakoune's faces. For example, from config/config.toml:

[language.rust.faces]
attribute = "meta"
comment = "comment"
function = "function"
keyword = "keyword"
operator = "operator"
string = "string"
type = "type"
type-builtin = "type"
constructor = "value"
constant = "value"
constant-builtin = "value"

The captures are defined in the languages query file, which are currently shipped with the library instead of being configurable.

Supported Languages

Currently, only rust is supported. Other languages are easy to add though, adding them as a dependency in the Cargo.toml file and matching against them in languages/mod.rs.

TODO

  • add more languages
  • make the query files configurable
  • autoload the default config
  • add commands for querying the AST
  • add documentation for commands & requests
You might also like...
Build your service-server fast, easy (and without hosting!)
Build your service-server fast, easy (and without hosting!)

service-io is a library to build servers that offering services with really little effort. Choose an input connector. Choose an output connector. Choo

A stupidly simple and easy to self-host, personal server for file hosting on the web
A stupidly simple and easy to self-host, personal server for file hosting on the web

Grasswave CDN A stupidly simple and easy to self-host, personal server for file hosting on the web. Written in Rust. Thanks, @Maciejowski, for the sty

An ActivityPub home server written in Rust, implementing the Mastodon API.

Tafarn An ActivityPub home server written in Rust, implementing the Mastodon API. At present no web UI is provided, the API is the only way to interac

An MVP-worthy background job server for PostgreSQL, written in Rust
An MVP-worthy background job server for PostgreSQL, written in Rust

Pointguard An MVP-worthy background job server for PostgreSQL, written in Rust A simple background job server (database) on top of PostgreSQL, that ca

tree-sitter meets Kakoune

kak-tree-sitter This is a binary server that interfaces tree-sitter with kakoune. Features Install Usage Design Credits Features Semantic highlighting

Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface

tree-sitter-traversal Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface. Using cursors, iteration over the tree c

Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

Like grep, but uses tree-sitter grammars to search

tree-grepper Works like grep, but uses tree-sitter to search for structure instead of strings. Installing This isn't available packaged anywhere. That

A syntax highlighter for Node powered by Tree Sitter. Written in Rust.

tree-sitter-highlight A syntax highlighter for Node.js powered by Tree Sitter. Written in Rust. Usage The following will output HTML: const treeSitter

Tree-sitter - An incremental parsing system for programming tools

tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and effic

A tree-sitter based AST difftool to get meaningful semantic diffs
A tree-sitter based AST difftool to get meaningful semantic diffs

diffsitter Disclaimer diffsitter is very much a work in progress and nowhere close to production ready (yet). Contributions are always welcome! Summar

Semantic find-and-replace using tree-sitter-based macro expansion

Semantic find-and-replace using tree-sitter-based macro expansion

A Markdown to HTML compiler and Syntax Highlighter, built using Rust's pulldown-cmark and tree-sitter-highlight crates.

A blazingly fast( possibly the fastest) markdown to html parser and syntax highlighter built using Rust's pulldown-cmark and tree-sitter-highlight crate natively for Node's Foreign Function Interface.

Mypyc DSL grammar for tree-sitter
Mypyc DSL grammar for tree-sitter

tree-sitter-mypyc Mypyc DSL grammar for tree-sitter. Installing (Neovim) This is based on the Neovim Tree-sitter docs for adding new parsers. Basicall

rehype plugin to use tree-sitter to highlight code in pre code blocks

rehype-tree-sitter rehype plugin to use tree-sitter to highlight code in precode blocks Contents What is this? When should I use this? Install Use

Kakoune Language Server Protocol Client

Kakoune Language Server Protocol Client kak-lsp is a Language Server Protocol client for Kakoune implemented in Rust. Installation Note kak-lsp.toml d

Thin wrapper around starship.rs to format kakoune status line

kakship is just a thin wrapper around starship to format the status line of kakoune and is meant to be used with the included kakoune script kakship.kak.

Integrating `coqidetop` inside Kakoune
Integrating `coqidetop` inside Kakoune

This plugin aims at providing a functional and usable coqidetop wrapper for use with Kakoune. For a list of things left to do, see the end of this REA

Helix - A kakoune / neovim inspired editor, written in Rust
Helix - A kakoune / neovim inspired editor, written in Rust

A kakoune / neovim inspired editor, written in Rust. The editing model is very heavily based on kakoune; during development I found myself agree

Owner
Enrico Borba
Enrico Borba
Render cargo dependency tree in online

Cargo Tree Online Check out rendered page Render cargo dependency tree in online. Usage trunk serve Copy and paste the content of Cargo.lock file to

Kangwook Lee (이강욱) 2 Sep 23, 2021
File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files.

FTZZ File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files. Installation $ cargo +nightly install

Alex Saveau 22 Dec 28, 2022
Automatically build a Rust module tree from the project directory structure

Hypermod An even lazier version of automod and supermod. Searches the src/ directory recursively for .rs files, then builds a module tree using the di

null 4 Aug 3, 2022
Rust library to scan files and expand multi-file crates source code as a single tree

syn-file-expand This library allows you to load full source code of multi-file crates into a single syn::File. Features: Based on syn crate. Handling

Vitaly Shukela 11 Jul 27, 2022
A balanced unbounded interval-tree in Rust with associated values in the nodes

store-interval-tree A balanced unbounded interval-tree in Rust with associated values in the nodes. Based on rudac and bio. Example use store_interval

Andrea Fioraldi 3 Nov 22, 2022
client-server notification center for dbus desktop notifications

tsuchita A client-server notification center for dbus desktop notifications. Specifically org.freedesktop.Notifications dbus messages. Motivation I ju

Jeff Zhao 7 Oct 9, 2022
Rust implementation of the legacy Master Server Query Protocol

msq-rs Rust library implementation of the legacy Master Server Query Protocol. Documentation crates.io Repository Release Notes Usage Add this to your

mtcw 6 Nov 20, 2022
Simple fake AWS Cognito User Pool API server for development.

Fakey Cognito ?? Homepage Simple fake AWS Cognito API server for development. ✅ Implemented features AdminXxx on User Pools API. Get Started # run wit

naokirin 4 Aug 30, 2022
A custom invoke system for Tauri that leverages a localhost server

Tauri Invoke HTTP This is a crate that provides a custom invoke system for Tauri using a localhost server. Each message is delivered through a XMLHttp

Tauri 17 Dec 17, 2022
PM-Tools - a simple Rust util to easily create server directories

PM-Tools PM-Tools is a simple Rust util to easily create server directories or plugins without the hassle of unzipping or creating directories Progres

null 2 Mar 19, 2022