## LaTeX forum ⇒ Others ⇒ vim in terminal and syntax highlight

Information and discussion about other LaTeX editors not listed above
AliceWonderMisc
Posts: 17
Joined: Mon Aug 20, 2018 3:27 pm

### vim in terminal and syntax highlight

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?

AliceWonderMisc
Posts: 17
Joined: Mon Aug 20, 2018 3:27 pm
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.

kaiserkarl13
Posts: 623
Joined: Tue Mar 25, 2008 5:02 pm
The line in tex.vim that sets up this particular piece of syntax highlighting is
syntax region texZone           start="\\begin{[vV]erbatim}"            end="\\end{[vV]erbatim}\|%stopzone\>"

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):
:syntax region texZone           start="\\begin{ManVerbatim}"            end="\\end{ManVerbatim}\|%stopzone\>"

AliceWonderMisc
Posts: 17
Joined: Mon Aug 20, 2018 3:27 pm
Thank you! Worked perfectly.

AliceWonderMisc
Posts: 17
Joined: Mon Aug 20, 2018 3:27 pm
Note -