Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bezhermoso/tree-sitter-ghostty
Tree-sitter grammar for Ghostty configuration files
https://github.com/bezhermoso/tree-sitter-ghostty
ghostty neovim-plugin tree-sitter tree-sitter-grammar tree-sitter-parser
Last synced: 3 days ago
JSON representation
Tree-sitter grammar for Ghostty configuration files
- Host: GitHub
- URL: https://github.com/bezhermoso/tree-sitter-ghostty
- Owner: bezhermoso
- License: mit
- Created: 2024-12-27T01:39:35.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-02-07T06:30:20.000Z (14 days ago)
- Last Synced: 2025-02-07T07:26:55.437Z (14 days ago)
- Topics: ghostty, neovim-plugin, tree-sitter, tree-sitter-grammar, tree-sitter-parser
- Language: JavaScript
- Homepage:
- Size: 241 KB
- Stars: 21
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-ghostty
![]()
![]()
## TODOs
- Grammar
- [x] Comments
- [x] Raw values
- [x] Numbers
- [x] Percents
- [x] Colors
- [x] Palette
- [x] Keybindings
- [x] Chords
- [x] Modifiers
- [x] Actions & arguments
- [x] Special keys (e.g. `tab`, `space`, `up`)
- [x] Tests
- [x] Capture highlight groups
- [x] Stable release
- [ ] Contribute queries to [nvim-treesitter] (No longer accepting experimental parsers)## Neovim
### lazy.nvim
Add this:
```lua
{
"bezhermoso/tree-sitter-ghostty",
build = "make nvim_install",
}
```> [!NOTE]
> Having [nvim-treesitter] installed is not required. However if you have it installed, this plugin will attempt to register
> itself as a parser so that `nvim-treesitter` can manage it e.g. `:TSInstall! ghostty`.Installing this as a plugin should automatically enable syntax highlighting for Ghostty configuration files located in
expected paths. You can add this line to the top of your config file if its filetype is not detected automatically:```diff
+# vim: ft=ghostty
#
# The rest of your Ghostty configuration 👻...
```## Helix
This grammar is now included in upstream Helix: https://github.com/helix-editor/helix, however if you do not current have highlighting, you can set it up manually using the following steps:
1. Add this to your `languages.toml`
```toml
[[language]]
name = "ghostty"
scope = "source.ghostty"
file-types = [{ glob = "ghostty/config" }]
comment-tokens = "#"
indent = { tab-width = 2, unit = " " }[[grammar]]
name = "ghostty"
source = { git = "https://github.com/bezhermoso/tree-sitter-ghostty" , rev = "8438a93b44367e962b2ea3a3b6511885bebd196a" }
```2. Download the ghostty [highlight queries from upstream](https://github.com/helix-editor/helix/blob/master/runtime/queries/ghostty/highlights.scm) and install them into the Helix runtime directory (located in config): `runtime/queries/ghostty/highlights.scm`
3. Build and fetch the grammar
```
hx -g fetch && hx -g build
```