aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Zhenyu <wuzhenyu@ustc.edu>2024-02-14 10:15:10 +0800
committerChristian Clason <c.clason@uni-graz.at>2024-02-15 09:39:10 +0100
commite4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4 (patch)
treebc65db1a116d3b51d3239506a8dfd492156e2079
parentfix(latex): update bibstyle queries (#6102) (diff)
downloadnvim-treesitter-e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4.tar
nvim-treesitter-e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4.tar.gz
nvim-treesitter-e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4.tar.bz2
nvim-treesitter-e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4.tar.lz
nvim-treesitter-e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4.tar.xz
nvim-treesitter-e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4.tar.zst
nvim-treesitter-e4a1cc6e8eaecfde4daa8d6295f5bc3e3c5cdbc4.zip
feat: add the muttrc parser
-rw-r--r--README.md1
-rw-r--r--lockfile.json3
-rw-r--r--lua/nvim-treesitter/parsers.lua9
-rw-r--r--queries/muttrc/highlights.scm53
-rw-r--r--queries/muttrc/injections.scm8
5 files changed, 74 insertions, 0 deletions
diff --git a/README.md b/README.md
index 5c27c7d6d..56066ec79 100644
--- a/README.md
+++ b/README.md
@@ -308,6 +308,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [ ] [mermaid](https://github.com/monaqa/tree-sitter-mermaid) (experimental)
- [x] [meson](https://github.com/Decodetalkers/tree-sitter-meson) (maintained by @Decodetalkers)
- [x] [mlir](https://github.com/artagnon/tree-sitter-mlir) (experimental, maintained by @artagnon)
+- [x] [muttrc](https://github.com/neomutt/tree-sitter-muttrc) (maintained by @Freed-Wu)
- [x] [nasm](https://github.com/naclsn/tree-sitter-nasm) (maintained by @ObserverOfTime)
- [ ] [nickel](https://github.com/nickel-lang/tree-sitter-nickel)
- [x] [nim](https://github.com/alaviss/tree-sitter-nim) (maintained by @aMOPel)
diff --git a/lockfile.json b/lockfile.json
index ea77c2ddb..e6356a0f3 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -404,6 +404,9 @@
"mlir": {
"revision": "650a8fb72013ba8d169bdb458e480d640fc545c9"
},
+ "muttrc": {
+ "revision": "9d4e1774e754f55a867638ab6a81335cf1078c23"
+ },
"nasm": {
"revision": "3bc691d2cfba44bea339a775ad496c8bc552c60d"
},
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index c9e312784..10d450690 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -47,6 +47,7 @@ for ft, lang in pairs {
xsd = "xml",
xslt = "xml",
sbt = "scala",
+ neomuttrc = "muttrc",
} do
register_lang(lang, ft)
end
@@ -1212,6 +1213,14 @@ list.mlir = {
maintainers = { "@artagnon" },
}
+list.muttrc = {
+ install_info = {
+ url = "https://github.com/neomutt/tree-sitter-muttrc",
+ files = { "src/parser.c" },
+ },
+ maintainers = { "@Freed-Wu" },
+}
+
list.nasm = {
install_info = {
url = "https://github.com/naclsn/tree-sitter-nasm",
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"))