diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 404749456..906548e65 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -64,6 +64,7 @@ | gdscript | ✓ | ✓ | ✓ | | | gemini | ✓ | | | | | gherkin | ✓ | | | | +| ghostty | ✓ | | | | | git-attributes | ✓ | | | | | git-commit | ✓ | ✓ | | | | git-config | ✓ | ✓ | | | diff --git a/languages.toml b/languages.toml index aa43784f6..a5a3c395e 100644 --- a/languages.toml +++ b/languages.toml @@ -2829,7 +2829,6 @@ file-types = [ "network", { glob = ".editorconfig" }, { glob = ".npmrc" }, - { glob = "ghostty/config" }, { glob = "hgrc" }, { glob = "npmrc" }, { glob = "rclone.conf" }, @@ -4077,3 +4076,14 @@ indent = { tab-width = 4, unit = " " } [[grammar]] name = "gren" source = { git = "https://github.com/MaeBrooks/tree-sitter-gren", rev = "76554f4f2339f5a24eed19c58f2079b51c694152" } + +[[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" } diff --git a/runtime/queries/ghostty/highlights.scm b/runtime/queries/ghostty/highlights.scm new file mode 100644 index 000000000..aa31bbc3e --- /dev/null +++ b/runtime/queries/ghostty/highlights.scm @@ -0,0 +1,68 @@ +; extends +; Comments +(comment) @comment + +; Keys +(property) @variable + +; Values +(boolean) @constant.builtin.boolean + + +[ + (number) + (adjustment) +] @constant.numeric + +[ + "+" + "=" + (keybind_trigger ">") +] @operator + +(":") @punctuation.delimiter + +; (color) are hex values +(color "#" @punctuation.special + (#eq? @punctuation.special "#")) + +(path_value "?" @keyword.control.conditional + (#eq? @keyword.control.conditional "?")) + +; `palette` +(palette_index) @variable.other.member + +; `path_directive` +(path_directive (property) @keyword.import) +(path_directive (path_value (string) @string.special.path )) + + +(action_name) @function.builtin +(action_argument (string) @variable.parameter ) + +; (tuple) +(tuple "," @punctuation.delimiter.special + (#eq? @punctuation.delimiter.special ",")) + +[ + (string) + (color) +] @string + +; clear is a special keyword that clear all existing keybind up to that point +((keybind_value) @keyword + (#eq? @keyword "clear")) + +; `keybind` +(keybind_value) @string.special + +; NOTE: The order here matters! +[ + (key_qualifier) + (keybind_modifier) +] @attribute + +[ + (modifier_key) + (key) +] @constant.builtin