https://github.com/rszyma/vscode-kanata
Language support for kanata configuration files in VS Code
https://github.com/rszyma/vscode-kanata
kanata lsp rust vscode-extension wasm
Last synced: 5 months ago
JSON representation
Language support for kanata configuration files in VS Code
- Host: GitHub
- URL: https://github.com/rszyma/vscode-kanata
- Owner: rszyma
- License: lgpl-3.0
- Created: 2023-06-27T19:01:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-02-12T06:40:11.000Z (5 months ago)
- Last Synced: 2026-02-12T16:08:36.823Z (5 months ago)
- Topics: kanata, lsp, rust, vscode-extension, wasm
- Language: Rust
- Homepage: https://marketplace.visualstudio.com/items?itemName=rszyma.vscode-kanata
- Size: 1.01 MB
- Stars: 45
- Watchers: 1
- Forks: 4
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome - rszyma/vscode-kanata
README
# vscode-kanata
[](https://github.com/rszyma/vscode-kanata)
[](https://marketplace.visualstudio.com/items?itemName=rszyma.vscode-kanata)

A VS Code extension that adds language support for [kanata](https://github.com/jtroo/kanata) configuration files.
Available at
- VS Code Marketplace - https://marketplace.visualstudio.com/items?itemName=rszyma.vscode-kanata
- Open VSX - https://open-vsx.org/extension/rszyma/vscode-kanata
This extension aims to stay up-to-date with latest kanata git.
Whenever something changes in `parser` folder in kanata repository, at the end of the day, Github Actions will automatically build a new version of this extension with updated parser.
## Features
Kanata config files are detected by `.kbd` file extension.
### Syntax highlighting
keywords, action identifiers, alias handles etc.

### Checking for config errors
Config will be parsed and validated, when saving document.

### Support for including other files
If you use [`include`](https://github.com/jtroo/kanata/blob/main/docs/config.adoc#include-other-files) configuration items in your kanata config, make sure to adjust the following settings:
- `vscode-kanata.includesAndWorkspaces`
- `vscode-kanata.mainConfigFile`
Important: Absolute paths in `include` blocks that point outside the opened workspace aren't supported.
Also, if you work with multiple main files, and find yourself switching `mainConfigFile` often, there's a handy command palette entry:
- `Kanata: Set current file as main`
### Formatter: auto-apply spacial layout of `defsrc` to all `deflayer`s
This is enabled by default, because I've seen a lot of kanata configs, and it seems like
majority of users prefer to align their `deflayer`s according to spacial layout of `defsrc`.
If you have "Auto format on save enabled" and don't want this feature, you can disable
it in settings (search for "kanata.format").
### Goto definition
- CTRL+Click on an identifier to go to definition
- CTRL+Click on a definition to reveal references.
Implemented for aliases, variables, layers, virtualkeys, templates and includes.
Supported in both single-mode and workspace (includes-enabled) mode.
### Symbol rename
Symbol rename is supported for everything that Goto Defintion supports, except for includes.
By default, it can be triggered by pressing F2 on a symbol you want to rename.
## Contributing
If you have an idea what could be improved, feel free to open an issue or a PR.
### Bug reports
If you encounter a bug, please report it here: https://github.com/rszyma/vscode-kanata/issues
### Hacking
See [HACKING.md](HACKING.md) for build instructions and other useful bits for developers.
## Release notes
See the [change log](CHANGELOG.md).
## Credits
- https://github.com/jtroo/kanata/ - provides kanata-parser crate
- https://github.com/osohq/oso - used this as vscode extension template (with a lot of things removed)
- https://github.com/canadaduane/vscode-kmonad - syntax highlighting config
- https://github.com/jtroo/kanata/blob/main/assets/kanata-icon.svg - kanata icon
- https://github.com/entibo/vscode-kmonad-format - the idea of formatting `deflayer`s according to spacing in `defsrc`