highlights.scm 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ;From MDeiml/tree-sitter-markdown & Helix
  2. (setext_heading
  3. (paragraph) @markup.heading.1
  4. (setext_h1_underline) @markup.heading.1)
  5. (setext_heading
  6. (paragraph) @markup.heading.2
  7. (setext_h2_underline) @markup.heading.2)
  8. (atx_heading
  9. (atx_h1_marker)) @markup.heading.1
  10. (atx_heading
  11. (atx_h2_marker)) @markup.heading.2
  12. (atx_heading
  13. (atx_h3_marker)) @markup.heading.3
  14. (atx_heading
  15. (atx_h4_marker)) @markup.heading.4
  16. (atx_heading
  17. (atx_h5_marker)) @markup.heading.5
  18. (atx_heading
  19. (atx_h6_marker)) @markup.heading.6
  20. (info_string) @label
  21. (pipe_table_header
  22. (pipe_table_cell) @markup.heading)
  23. (pipe_table_header
  24. "|" @punctuation.special)
  25. (pipe_table_row
  26. "|" @punctuation.special)
  27. (pipe_table_delimiter_row
  28. "|" @punctuation.special)
  29. (pipe_table_delimiter_cell) @punctuation.special
  30. ; Code blocks (conceal backticks and language annotation)
  31. (indented_code_block) @markup.raw.block
  32. ((fenced_code_block) @markup.raw.block
  33. (#set! priority 90))
  34. (fenced_code_block
  35. (fenced_code_block_delimiter) @markup.raw.block
  36. (#set! conceal "")
  37. (#set! conceal_lines ""))
  38. (fenced_code_block
  39. (info_string
  40. (language) @label
  41. (#set! conceal "")
  42. (#set! conceal_lines "")))
  43. (link_destination) @markup.link.url
  44. [
  45. (link_title)
  46. (link_label)
  47. ] @markup.link.label
  48. ((link_label)
  49. .
  50. ":" @punctuation.delimiter)
  51. [
  52. (list_marker_plus)
  53. (list_marker_minus)
  54. (list_marker_star)
  55. (list_marker_dot)
  56. (list_marker_parenthesis)
  57. ] @markup.list
  58. ; NOTE: The following has been commented out due to issues with spaces in the
  59. ; list marker nodes generated by the parser. If those spaces ever get captured
  60. ; by a different node (e.g. block_continuation) we can safely re-add these
  61. ; conceals.
  62. ; ;; Conceal bullet points
  63. ; ([(list_marker_plus) (list_marker_star)]
  64. ; @punctuation.special
  65. ; (#offset! @punctuation.special 0 0 0 -1)
  66. ; (#set! conceal "•"))
  67. ; ([(list_marker_plus) (list_marker_star)]
  68. ; @punctuation.special
  69. ; (#any-of? @punctuation.special "+" "*")
  70. ; (#set! conceal "•"))
  71. ; ((list_marker_minus)
  72. ; @punctuation.special
  73. ; (#offset! @punctuation.special 0 0 0 -1)
  74. ; (#set! conceal "—"))
  75. ; ((list_marker_minus)
  76. ; @punctuation.special
  77. ; (#eq? @punctuation.special "-")
  78. ; (#set! conceal "—"))
  79. (thematic_break) @punctuation.special
  80. (task_list_marker_unchecked) @markup.list.unchecked
  81. (task_list_marker_checked) @markup.list.checked
  82. ((block_quote) @markup.quote
  83. (#set! priority 90))
  84. ([
  85. (plus_metadata)
  86. (minus_metadata)
  87. ] @keyword.directive
  88. (#set! priority 90))
  89. [
  90. (block_continuation)
  91. (block_quote_marker)
  92. ] @punctuation.special
  93. (backslash_escape) @string.escape
  94. (inline) @spell