Hello,
I'm currently porting some man pages to LaTeX for the appendix of another documentation project I'm working on.
The color syntax works well enough but one issue -
When I use \begin{Verbatim} it can figure out that $ within are not the start of math.
however I'm actually using \begin{ManVerbatim} where I've defined ManVerbatim via \newtcblisting{ManVerbatim} {}
The vim syntax highlighting no longer figures out that $ within are not related to math mode.
Anyone know of a way to tell the vim syntax highlighting to treat my custom ManVerbatim as if it was verbatim or Verbatim?
Others ⇒ vim in terminal and syntax highlight
-
- Posts: 17
- Joined: Mon Aug 20, 2018 3:27 pm
vim in terminal and syntax highlight
The file presently working on where it is an issue -
https://gitlab.com/Pipfrosch/librelampd ... .cnf.5.tex
Line 326 (line number may change as I work on it) in the gitlab rendering shows where start of issue is - I don't care about gitlab getting it right, but it's annoying in vim where I am editing the file.
https://gitlab.com/Pipfrosch/librelampd ... .cnf.5.tex
Line 326 (line number may change as I work on it) in the gitlab rendering shows where start of issue is - I don't care about gitlab getting it right, but it's annoying in vim where I am editing the file.
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
vim in terminal and syntax highlight
The line in tex.vim that sets up this particular piece of syntax highlighting is
If you enter the following command, it will do the syntax highlighting the way you want it (just enter this right in VIM, with the colon, in command mode):
Code: Select all
syntax region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>"
Code: Select all
:syntax region texZone start="\\begin{ManVerbatim}" end="\\end{ManVerbatim}\|%stopzone\>"
-
- Posts: 17
- Joined: Mon Aug 20, 2018 3:27 pm
vim in terminal and syntax highlight
Thank you! Worked perfectly.
-
- Posts: 17
- Joined: Mon Aug 20, 2018 3:27 pm
vim in terminal and syntax highlight
Note -
Also discovered (while reading the tex.vim file) that adding
%stopzone
to the LaTeX file also tells vim to restore normal syntax highlight when a custom Verbatim environment causes a problem.
Adding note here in case search engines send people here.
Also discovered (while reading the tex.vim file) that adding
%stopzone
to the LaTeX file also tells vim to restore normal syntax highlight when a custom Verbatim environment causes a problem.
Adding note here in case search engines send people here.