tree-sitter-kitty

September 11, 2025 ยท View on GitHub

Syntax highlighting

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, pointer etc.)
  • 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

  1. Install the tree-sitter CLI tool.

  2. Clone the repository in your machine and cd into it.

  3. Run tree-sitter build(if it tells you to install dependencies then you should install them and retry).

  4. Copy the kitty.so file to ~/.config/nvim/parser/.

๐Ÿ’ฅ Query files(syntax highlighting & injections)

Copy everything inside queries/ into ~/.config/nvim/queries/kitty/ in your machine.