neovim/queries/bash/injections.scm

31 lines
782 B
Scheme

; Syntax highlighting for heredoc (<<EOF...EOF) content in shell scripts
(#set! injection.language "")
(redirected_statement
; Capture the command name
; Check if the command is awk
(command
name: (command_name) @cmd (#eq? @cmd "awk"))
; If the command is awk, use the heredoc_body as the content of the injection
(heredoc_redirect
(heredoc_body) @injection.content (#set! injection.language "awk"))
)
(redirected_statement
(command
name: (command_name) @cmd (#eq? @cmd "lua"))
(heredoc_redirect
(heredoc_body) @injection.content (#set! injection.language "lua"))
)
(redirected_statement
(command
name: (command_name) @cmd (#eq? @cmd "expect"))
(heredoc_redirect
(heredoc_body) @injection.content (#set! injection.language "tcl"))
)