tree-sitter-kitty
September 11, 2025 ยท View on GitHub

Tree-sitter parser for kitty.conf.
๐ก Features
- Supports various syntax,
- Comments
- Includes(+ variants)
- Options
- Keyboard shortcuts
- Mouse shortcuts
- Action alias
- Extensive primitive data type support,
- Pixel(
7px) - Percentage
- Number
- Boolean
- Color
- String
- Time
- Others(e.g.
axis,cursor,pointeretc.)
- Pixel(
- Supports line continuation via
\. - Syntax highlighting queries.
- Injection support.
๐ฅ Installation
๐ก nvim-treesitter
Important
Make sure to set your filetype to kitty. You can copy over the example ftdetect/kitty.lua in your config to do this automatically.
Be aware that this only identifies .conf files in .config/kitty and kitty.conf anywhere else in the filesystem
Note
This will not add syntax highlighting. For adding syntax highlighting see this section.
Put this in your nvim-treesitter config,
Branch: main
vim.api.nvim_create_autocmd("User", {
pattern = "TSUpdate",
callback = function()
require("nvim-treesitter.parsers").kitty = {
install_info = {
url = "https://github.com/OXY2DEV/tree-sitter-kitty",
},
}
end
})
Branch: master
local parser_configs = require("nvim-treesitter.parsers").get_parser_configs();
parser_configs.kitty = {
install_info = {
url = "https://github.com/OXY2DEV/tree-sitter-kitty",
files = { "src/parser.c" },
branch = "main",
},
}
Now, quit & open Neovim and run this command,
:TSInstall kitty
๐ก manual
-
Install the
tree-sitterCLI tool. -
Clone the repository in your machine and
cdinto it. -
Run
tree-sitter build(if it tells you to install dependencies then you should install them and retry). -
Copy the
kitty.sofile to~/.config/nvim/parser/.
๐ฅ Query files(syntax highlighting & injections)
Copy everything inside queries/ into ~/.config/nvim/queries/kitty/ in your machine.