@atoolz/kitty-lsp-toolkit
v0.1.1
Published
Language Server Protocol implementation for Kitty terminal configuration files
Maintainers
Readme
Kitty is a fast, feature-rich, GPU-based terminal emulator. This language server brings IntelliSense, validation, and documentation for kitty.conf to any editor that supports the Language Server Protocol (Neovim, Helix, Emacs, Zed, Sublime Text, and more).
Features
IntelliSense Completions
Context-aware autocompletion for all 300+ kitty options, directives, and actions.
- Option names with descriptions, types, defaults, and snippet insertion
- Enum values for options like
cursor_shape,tab_bar_style,placement_strategy - Color values with hex presets from popular themes (Gruvbox, Catppuccin, Dracula, Solarized)
- Map actions for
mapandmouse_mapdirectives (80+ actions) - Directive snippets for
map,mouse_map,include,globinclude,env
Hover Documentation
Hover over any option to see its description, type, default value, allowed values, and a link to the kitty docs.
Diagnostics and Validation
Real-time validation catches configuration errors as you type:
- Unknown option names
- Invalid boolean values (only
yes/noare valid in kitty) - Invalid number values
- Invalid enum values with the list of accepted alternatives
- Invalid color formats
Installation
npm install -g kitty-lsp-toolkitThis installs the kitty-lsp binary globally.
Editor Setup
Neovim
vim.api.nvim_create_autocmd("FileType", {
pattern = "kitty",
callback = function()
vim.lsp.start({
name = "kitty-lsp",
cmd = { "kitty-lsp" },
})
end,
})To detect kitty.conf as filetype kitty, add to your init.lua:
vim.filetype.add({
filename = {
["kitty.conf"] = "kitty",
},
pattern = {
[".*/kitty/.*%.conf"] = "kitty",
},
})Helix
Add to ~/.config/helix/languages.toml:
[language-server.kitty-lsp]
command = "kitty-lsp"
[[language]]
name = "kitty"
scope = "source.kitty"
file-types = [{ glob = "kitty.conf" }, { glob = "*/kitty/*.conf" }]
language-servers = ["kitty-lsp"]Emacs (lsp-mode)
(with-eval-after-load 'lsp-mode
(add-to-list 'lsp-language-id-configuration '(".*kitty.*\\.conf$" . "kitty"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection '("kitty-lsp"))
:activation-fn (lsp-activate-on "kitty")
:server-id 'kitty-lsp)))Sublime Text (LSP package)
Add to LSP settings:
{
"clients": {
"kitty-lsp": {
"command": ["kitty-lsp"],
"selector": "source.kitty"
}
}
}Zed
Add to your Zed settings:
{
"lsp": {
"kitty-lsp": {
"binary": {
"path": "kitty-lsp"
}
}
}
}Supported Categories
All major kitty configuration categories are covered:
Fonts Cursor Scrollback Mouse Performance Terminal Bell Window Layout Tab Bar Colors Advanced
VS Code
For VS Code, use the companion extension Kitty Toolkit which includes syntax highlighting, snippets, and all features from this LSP built-in.
Contributing
Contributions are welcome. Please open an issue or pull request on GitHub.
