kakehashi is a bridge (ζΆγζ©) across your editors, your languages, and the language servers that make them smart.
- bridge to consistent syntax highlighting and smart selection β for any language with a Tree-sitter grammar
- bridge to your language servers' features β configured once in kakehashi, available in any editor
- bridge to all of the above β even for code embedded inside other code
flowchart TB
K[π kakehashi] <-->|Highlighting, selection,<br>and more β everywhere| E["Your editor<br>(any LSP client)"]
K <-.->|Borrows the smarts of<br>real language servers| LS["pyright, rust-analyzer,<br>and friends"]
Open a file and kakehashi highlights it β consistently, in every editor. It parses with Tree-sitter, so any language with a grammar just works (that's hundreds of them), and it fetches the grammar it needs automatically the first time you open a file. No manual installs, no config to get started.
The same engine powers smart selection: grow or shrink your selection along the code's real structure, not just by lines and words.
Need a niche language, or want highlighting your way? Bring your own Tree-sitter grammar and query files and kakehashi picks them up too β nothing is locked in.
The deep features β completions, hover, go-to-definition β come from the real language servers you already trust, like pyright, rust-analyzer, or marksman. kakehashi connects your document to the right one and routes its answers back into your editor.
Best of all, you set them up once in kakehashi. Move from Neovim to VS Code to Helix and the same language tooling follows you β no per-editor configuration to redo.
You're writing a Markdown README, a Jupyter-style notebook, or an R Markdown report. It's full of embedded code:
```python
import pandas as pd
df = pd.read_csv("data.csv")
df. # β completions, right here
```kakehashi spots these embedded regions and reaches both bridges right inside them:
- β¨ Highlighting that understands each embedded language
- π§ Completions, hover, and go-to-definition from its language server, inline
- π― Smart selection that follows the embedded code's structure
The same trick works anywhere languages nest β SQL in a JavaScript string, CSS and JavaScript in HTML, code blocks in Markdown. A single Markdown file can get marksman for the prose and pyright for the Python blocks, all at once.
Want to see kakehashi in action before wiring it into your own setup? Clone the repo and launch a ready-to-go Neovim:
make deps/nvim
nvim -u scripts/minimal_init.luaOpen a Markdown file with a code block and watch the highlighting and completions light up.
Download the binary for your platform from GitHub Releases and put it on your PATH.
To let kakehashi auto-install the parsers it needs, make sure a C compiler is available (xcode-select --install on macOS, build-essential on Debian/Ubuntu, Build Tools on Windows).
Neovim (built-in LSP, 0.11+):
vim.lsp.config.kakehashi = {
cmd = { "kakehashi" },
init_options = { autoInstall = true },
on_attach = function(_, bufnr)
-- Let kakehashi own highlighting (avoids double-highlighting)
vim.api.nvim_create_autocmd("LspTokenUpdate", {
buffer = bufnr,
once = true,
callback = function()
vim.opt_local.syntax = "OFF"
vim.treesitter.stop(bufnr)
end,
})
end,
}
vim.lsp.enable("kakehashi")Open a file and you'll have highlighting and smart selection immediately.
Want completions and hover inside your code blocks? Point kakehashi at the language servers you already use β for example pyright for Python or lua-language-server for Lua.
See docs/README.md for the full setup: connecting language servers, configuring other editors, the CLI, and every option.
MIT