diff --git a/languages.toml b/languages.toml index 8fbb98e883d17..d8b5195dead45 100644 --- a/languages.toml +++ b/languages.toml @@ -3284,3 +3284,15 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "ld" source = { git = "https://github.com/mtoohey31/tree-sitter-ld", rev = "81978cde3844bfc199851e39c80a20ec6444d35e" } + +[[language]] +name = "hyprland" +scope = "source.conf" +roots = ["hyprland.conf"] +file-types = [{ glob = "hyprland.conf"}] +comment-token = "#" +grammar = "hyprlang" + +[[grammar]] +name = "hyprlang" +source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-hyprlang", rev = "27af9b74acf89fa6bed4fb8cb8631994fcb2e6f3"} diff --git a/runtime/queries/hyprlang/highlights.scm b/runtime/queries/hyprlang/highlights.scm new file mode 100644 index 0000000000000..d76993d125110 --- /dev/null +++ b/runtime/queries/hyprlang/highlights.scm @@ -0,0 +1,56 @@ +(comment) @comment @spell + +[ + "source" + "exec" + "exec-once" +] @keyword + +(keyword + (name) @keyword) + +(assignment + (name) @property) + +(section + (name) @module) + +(section + device: (device_name) @type) + +(variable) @variable + +"$" @punctuation.special + +(boolean) @boolean + +(mod) @constant + +[ + "rgb" + "rgba" +] @function.builtin + +[ + (number) + (legacy_hex) + (angle) + (hex) +] @number + +"deg" @type + +"," @punctuation.delimiter + +[ + "(" + ")" + "{" + "}" +] @punctuation.bracket + +[ + "=" + "-" + "+" +] @operator diff --git a/runtime/queries/hyprlang/indents.scm b/runtime/queries/hyprlang/indents.scm new file mode 100644 index 0000000000000..731ae9a611eb4 --- /dev/null +++ b/runtime/queries/hyprlang/indents.scm @@ -0,0 +1,6 @@ +(section) @indent.begin + +(section + "}" @indent.end) + +"}" @indent.branch diff --git a/runtime/queries/hyprlang/injections.scm b/runtime/queries/hyprlang/injections.scm new file mode 100644 index 0000000000000..1f0199ed807dd --- /dev/null +++ b/runtime/queries/hyprlang/injections.scm @@ -0,0 +1,3 @@ +(exec + (string) @injection.content + (#set! injection.language "bash"))