aboutsummaryrefslogtreecommitdiffstats
path: root/queries/hyprlang
diff options
context:
space:
mode:
authorLuckas <luckasranarison@gmail.com>2024-02-09 12:19:46 +0300
committerGitHub <noreply@github.com>2024-02-09 10:19:46 +0100
commitbc07e58f425a5382acfac9ac34a317faa077943a (patch)
tree08be2a3e7dde6b9c32e8ba25c59fdc92f951243d /queries/hyprlang
parentUpdate README (diff)
downloadnvim-treesitter-bc07e58f425a5382acfac9ac34a317faa077943a.tar
nvim-treesitter-bc07e58f425a5382acfac9ac34a317faa077943a.tar.gz
nvim-treesitter-bc07e58f425a5382acfac9ac34a317faa077943a.tar.bz2
nvim-treesitter-bc07e58f425a5382acfac9ac34a317faa077943a.tar.lz
nvim-treesitter-bc07e58f425a5382acfac9ac34a317faa077943a.tar.xz
nvim-treesitter-bc07e58f425a5382acfac9ac34a317faa077943a.tar.zst
nvim-treesitter-bc07e58f425a5382acfac9ac34a317faa077943a.zip
feat: add hyprlang parser & queries (#5852)
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
Diffstat (limited to 'queries/hyprlang')
-rw-r--r--queries/hyprlang/folds.scm1
-rw-r--r--queries/hyprlang/highlights.scm56
-rw-r--r--queries/hyprlang/indents.scm6
3 files changed, 63 insertions, 0 deletions
diff --git a/queries/hyprlang/folds.scm b/queries/hyprlang/folds.scm
new file mode 100644
index 000000000..911798f5a
--- /dev/null
+++ b/queries/hyprlang/folds.scm
@@ -0,0 +1 @@
+(section) @fold
diff --git a/queries/hyprlang/highlights.scm b/queries/hyprlang/highlights.scm
new file mode 100644
index 000000000..d76993d12
--- /dev/null
+++ b/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/queries/hyprlang/indents.scm b/queries/hyprlang/indents.scm
new file mode 100644
index 000000000..731ae9a61
--- /dev/null
+++ b/queries/hyprlang/indents.scm
@@ -0,0 +1,6 @@
+(section) @indent.begin
+
+(section
+ "}" @indent.end)
+
+"}" @indent.branch