From e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4 Mon Sep 17 00:00:00 2001 From: Wu Zhenyu Date: Wed, 14 Feb 2024 10:15:10 +0800 Subject: feat: add the muttrc parser --- queries/muttrc/highlights.scm | 53 +++++++++++++++++++++++++++++++++++++++++++ queries/muttrc/injections.scm | 8 +++++++ 2 files changed, 61 insertions(+) create mode 100644 queries/muttrc/highlights.scm create mode 100644 queries/muttrc/injections.scm (limited to 'queries') diff --git a/queries/muttrc/highlights.scm b/queries/muttrc/highlights.scm new file mode 100644 index 000000000..187c6ee54 --- /dev/null +++ b/queries/muttrc/highlights.scm @@ -0,0 +1,53 @@ +; Comments +(comment) @comment @spell + +; General +(int) @number + +(string) @string + +[ + (map) + (object) + (composeobject) + (color) + (attribute) +] @string.special + +(quadoption) @boolean + +(path) @string.special.path + +(regex) @string.regexp + +[ + (option) + (command_line_option) +] @variable.builtin + +(command) @keyword + +(source_directive + (command) @keyword.import) + +(uri) @string.special.url + +(key_name) @constant.builtin + +(escape) @string.escape + +(function) @function.call + +; Literals +[ + "<" + ">" +] @punctuation.bracket + +"," @punctuation.delimiter + +[ + "&" + "?" + "*" +] @character.special diff --git a/queries/muttrc/injections.scm b/queries/muttrc/injections.scm new file mode 100644 index 000000000..9c16ad15a --- /dev/null +++ b/queries/muttrc/injections.scm @@ -0,0 +1,8 @@ +((regex) @injection.content + (#set! injection.language "regex")) + +((shell) @injection.content + (#set! injection.language "bash")) + +((comment) @injection.content + (#set! injection.language "comment")) -- cgit v1.2.3-70-g09d2