From 9f31070ab3741126e9fa7564b2d44d60caf48846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Sun, 7 Aug 2016 13:24:09 +0200 Subject: [PATCH] Add support for gnuplot nested highlighting (#514) --- after/syntax/tex.vim | 12 ++++++++++++ test/features/syntax/test-syntax.tex | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/after/syntax/tex.vim b/after/syntax/tex.vim index 230f25e..3aea2c8 100644 --- a/after/syntax/tex.vim +++ b/after/syntax/tex.vim @@ -189,6 +189,18 @@ syntax region texZone \ contains=texBeginEnd,@LUA let b:current_syntax = 'tex' +" }}}1 +" {{{1 Nested syntax highlighting for gnuplottex +unlet b:current_syntax +syntax include @GNUPLOT syntax/gnuplot.vim +syntax region texZone + \ start='\\begin{gnuplottex}\(\_s*\[\_[\]]\{-}\]\)\?'rs=s + \ end='\\end{gnuplottex}'re=e + \ keepend + \ transparent + \ contains=texBeginEnd,texBeginEndModifier,@GNUPLOT +let b:current_syntax = 'tex' + " }}}1 " {{{1 Nested syntax highlighting for minted diff --git a/test/features/syntax/test-syntax.tex b/test/features/syntax/test-syntax.tex index 19ed94a..6f1a916 100644 --- a/test/features/syntax/test-syntax.tex +++ b/test/features/syntax/test-syntax.tex @@ -27,6 +27,10 @@ testing } \end{dot2tex} +\begin{gnuplottex}[terminal=..., terminaloptions=...] + plot file using 1:2 with lines +\end{gnuplottex} + \begin{minted}{python} def function(arg): pass