Skip to content

Commit

Permalink
feat: add hyprland config language
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Mar 16, 2024
1 parent 6fea787 commit caea6ca
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
12 changes: 12 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
56 changes: 56 additions & 0 deletions runtime/queries/hyprlang/highlights.scm
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions runtime/queries/hyprlang/indents.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(section) @indent.begin

(section
"}" @indent.end)

"}" @indent.branch
3 changes: 3 additions & 0 deletions runtime/queries/hyprlang/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(exec
(string) @injection.content
(#set! injection.language "bash"))

0 comments on commit caea6ca

Please sign in to comment.