diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml index a0b656b7..6cebfe50 100644 --- a/.config/helix/languages.toml +++ b/.config/helix/languages.toml @@ -67,7 +67,7 @@ command = "iwes" [[language]] name = "markdown" -file-types = ["md", "livemd", "markdown", "mdx", "mkd", "mkdn", "mdwn", "mdown", "markdn", "mdtxt", "mdtext", "workbook", { glob = "PULLREQ_EDITMSG" }, { glob = "/tmp/aerc-compose-*.eml" }] +file-types = ["md", "livemd", "markdown", "mdx", "mkd", "mkdn", "mdwn", "mdown", "markdn", "mdtxt", "mdtext", "workbook", { glob = "PULLREQ_EDITMSG" } ] # language-servers = ["ltex-ls-plus", "marksman", "scls"] language-servers = ["harper-ls", "marksman", "scls"] formatter = { command = "dprint", args = ["fmt", "--stdin", "md", "-c", "~/.dprint.jsonc"] } @@ -99,18 +99,19 @@ name = "mail" language-servers = ["harper-ls"] # injection-regex = "mail|eml|email" -[[language]] -name = "aerc" -scope = "text.aerc" -file-types = [] -shebangs = [] -roots = [] -auto-format = true -formatter = { command = "/usr/lib/aerc/filters/wrap", args = ["-w", "74"] } +# [[language]] +# name = "aerc" +# scope = "text.aerc" +# file-types = [{ glob = "/tmp/aerc-compose-*.eml" }] +# # shebangs = [] +# # roots = [] +# auto-format = true +# formatter = { command = "/usr/lib/aerc/filters/wrap", args = ["-w", "74"] } -[[grammar]] -name = "aerc" -source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-markdown", rev = "62516e8c78380e3b51d5b55727995d2c511436d8", subpath = "tree-sitter-markdown" } +# [[grammar]] +# name = "aerc" +# source = { path = "/home/fic/tools/tree-sitter-markdown/tree-sitter-markdown"} +# # source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-markdown", rev = "62516e8c78380e3b51d5b55727995d2c511436d8", subpath = "tree-sitter-markdown" } [[grammar]] name = "ini" diff --git a/.config/helix/runtime/queries/aerc/highlights.scm b/.config/helix/runtime/queries/aerc/highlights.scm new file mode 100644 index 00000000..a80fc1be --- /dev/null +++ b/.config/helix/runtime/queries/aerc/highlights.scm @@ -0,0 +1,62 @@ + +(setext_heading (paragraph) @markup.heading.1 (setext_h1_underline) @markup.heading.marker) +(setext_heading (paragraph) @markup.heading.2 (setext_h2_underline) @markup.heading.marker) + +(atx_heading (atx_h1_marker) @markup.heading.marker) @markup.heading.1 +(atx_heading (atx_h2_marker) @markup.heading.marker) @markup.heading.2 +(atx_heading (atx_h3_marker) @markup.heading.marker) @markup.heading.3 +(atx_heading (atx_h4_marker) @markup.heading.marker) @markup.heading.4 +(atx_heading (atx_h5_marker) @markup.heading.marker) @markup.heading.5 +(atx_heading (atx_h6_marker) @markup.heading.marker) @markup.heading.6 + +[ + (indented_code_block) + (fenced_code_block) +] @markup.raw.block + +(info_string) @label + +[ + (fenced_code_block_delimiter) +] @punctuation.bracket + +[ + (link_destination) +] @markup.link.url + +[ + (link_label) +] @markup.link.label + +[ + (list_marker_plus) + (list_marker_minus) + (list_marker_star) +] @markup.list.unnumbered + +[ + (list_marker_dot) + (list_marker_parenthesis) +] @markup.list.numbered + +(task_list_marker_checked) @markup.list.checked +(task_list_marker_unchecked) @markup.list.unchecked + +(thematic_break) @punctuation.special + +[ + (block_continuation) + (block_quote_marker) +] @punctuation.special + +[ + (backslash_escape) +] @string.escape + +(block_quote) @markup.quote + +(pipe_table_row + "|" @punctuation.special) +(pipe_table_header + "|" @punctuation.special) +(pipe_table_delimiter_row) @punctuation.special diff --git a/.config/helix/runtime/queries/aerc/injections.scm b/.config/helix/runtime/queries/aerc/injections.scm new file mode 100644 index 00000000..80977459 --- /dev/null +++ b/.config/helix/runtime/queries/aerc/injections.scm @@ -0,0 +1,22 @@ +; From nvim-treesitter/nvim-treesitter + +(fenced_code_block + (code_fence_content) @injection.shebang @injection.content + (#set! injection.include-unnamed-children)) + +(fenced_code_block + (info_string + (language) @injection.language) + (code_fence_content) @injection.content (#set! injection.include-unnamed-children)) + +((html_block) @injection.content + (#set! injection.language "html") + (#set! injection.include-unnamed-children) + (#set! injection.combined)) + +((pipe_table_cell) @injection.content (#set! injection.language "markdown.inline") (#set! injection.include-unnamed-children)) + +((minus_metadata) @injection.content (#set! injection.language "yaml") (#set! injection.include-unnamed-children)) +((plus_metadata) @injection.content (#set! injection.language "toml") (#set! injection.include-unnamed-children)) + +((inline) @injection.content (#set! injection.language "markdown.inline") (#set! injection.include-unnamed-children))