added latex support and reorg ftplugins

This commit is contained in:
Jeremie Fraeys 2024-08-20 01:31:44 -04:00
parent 7f1b34fd6f
commit f2eaf7c67a
38 changed files with 600 additions and 234 deletions

View file

@ -0,0 +1,2 @@
;extend

View file

@ -0,0 +1,6 @@
;extends
(fenced_code_block (code_fence_content) @class.inner) @class.outer
(paragraph) @function.outer @function.inner

View file

@ -0,0 +1,13 @@
;extends
[
(shortcut_link)
] @nospell
(strikethrough
(emphasis_delimiter)
(strikethrough
(emphasis_delimiter)
(emphasis_delimiter))
(emphasis_delimiter))@markup.doublestrikethrough

View file

@ -0,0 +1,12 @@
; Injection for code blocks
(ranged_verbatim_tag (tag_name) @_tagname (tag_parameters .(tag_param) @injection.language) (ranged_verbatim_tag_content) @injection.content (#any-of? @_tagname "code" "embed"))
(ranged_verbatim_tag (tag_name) @_tagname (tag_parameters)? (ranged_verbatim_tag_content) @injection.content (#eq? @_tagname "math") (#set! injection.language "latex"))
(
(inline_math) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "latex")
)
(ranged_verbatim_tag (tag_name) @_tagname (ranged_verbatim_tag_content) @injection.content (#eq? @_tagname "document.meta") (#set! injection.language "norg_meta"))

View file

@ -0,0 +1,12 @@
;extends
(
(comment) @comment
(#match? @comment "^\\#\\|")
) @text.literal
(
(comment) @content
(#match? @content "^\\# ?\\%\\%")
) @class.outer @text.literal

View file

@ -0,0 +1,7 @@
;extends
(
(comment) @content1
(#match? @content1 "^\\# ?\\%\\%")
) @class.inner

View file

@ -0,0 +1,6 @@
;extends
(
(comment) @comment
(#match? @comment "^\\#\\|")
) @text.literal

View file

@ -0,0 +1,7 @@
;extends
(
(comment) @content1
(#match? @content1 "^\\# ?\\%\\%")
) @class.inner

View file

@ -0,0 +1,15 @@
;extends
(macro_invocation
(scoped_identifier
path: (identifier) @path (#eq? @path "sqlx")
name: (identifier) @name (#match? @name "^query.*")
)
(token_tree
(raw_string_literal) @injection.content
(#set! injection.language "sql")
(#set! injection.include-children)
)
(#offset! @injection.content 0 3 0 -2)
)