mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -04:00
feat(julia): Add syntax highlighting for markdown and bash prefixed_string_literals
This commit is contained in:
parent
b1e88723ee
commit
a0732ca9f0
1 changed files with 13 additions and 0 deletions
|
|
@ -13,14 +13,27 @@
|
||||||
(#set! injection.language "markdown")
|
(#set! injection.language "markdown")
|
||||||
(#offset! @injection.content 0 3 0 -3))
|
(#offset! @injection.content 0 3 0 -3))
|
||||||
|
|
||||||
|
; Inject comments
|
||||||
([
|
([
|
||||||
(line_comment)
|
(line_comment)
|
||||||
(block_comment)
|
(block_comment)
|
||||||
] @injection.content
|
] @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
|
; Inject regex in r"hello\bworld"
|
||||||
((prefixed_string_literal
|
((prefixed_string_literal
|
||||||
prefix: (identifier) @_prefix) @injection.content
|
prefix: (identifier) @_prefix) @injection.content
|
||||||
(#eq? @_prefix "r")
|
(#eq? @_prefix "r")
|
||||||
(#set! injection.language "regex")
|
(#set! injection.language "regex")
|
||||||
(#offset! @injection.content 0 2 0 -1))
|
(#offset! @injection.content 0 2 0 -1))
|
||||||
|
|
||||||
|
; Inject markdown in md"**Bold** and _Italics_"
|
||||||
|
((prefixed_string_literal
|
||||||
|
prefix: (identifier) @_prefix) @injection.content
|
||||||
|
(#eq? @_prefix "md")
|
||||||
|
(#set! injection.language "markdown")
|
||||||
|
(#offset! @injection.content 0 3 0 -1))
|
||||||
|
|
||||||
|
; Inject bash in `git add --help`
|
||||||
|
((command_literal) @injection.content
|
||||||
|
(#set! injection.language "bash"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue