From e789f3c71e78580959430e414f16ef5d1b2248ee Mon Sep 17 00:00:00 2001 From: Jan Hlavacek Date: Fri, 15 Apr 2022 15:07:57 -0400 Subject: [PATCH] Add syntax highlighting for Julia code blocks It seems like this can be done exactly the same way as for Python and R. I just copied the existing code from the Python highlighter and replaced Python by Julia and python by julia. --- syntax/quarto.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/syntax/quarto.vim b/syntax/quarto.vim index 2ef8eb1..3a618d9 100644 --- a/syntax/quarto.vim +++ b/syntax/quarto.vim @@ -16,3 +16,12 @@ exe 'syn region pandocPythonChunk '. \'contained containedin=pandocDelimitedCodeblock contains=@python' syn region pandocInlinePython matchgroup=Operator start=/`python\s/ end=/`/ contains=@Python concealends + +PandocHighlight julia +" quarto recognizes embedded Julia differently than regular pandoc +exe 'syn region pandocJuliaChunk '. + \'start=/\(```\s*{\s*julia.*\n\)\@<=\_^/ ' . + \'end=/\_$\n\(\(\s\{4,}\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ '. + \'contained containedin=pandocDelimitedCodeblock contains=@julia' + +syn region pandocInlineJulia matchgroup=Operator start=/`julia\s/ end=/`/ contains=@Julia concealends