Home Explore Blog CI



neovim

41th chunk of `runtime/doc/syntax.txt`
3216f41a5fe7526397ce0e74d18fa813321a54788e3b52250000000100000faf
	https://vimhelp.org/vim_faq.txt.html#faq-29.7
<
						*g:tex_nospell*
 Tex: No Spell Checking Wanted~

If you don't want spell checking anywhere in your LaTeX document, put >
	let g:tex_nospell=1
into your vimrc.  If you merely wish to suppress spell checking inside
comments only, see |g:tex_comment_nospell|.

				*tex-nospell* *g:tex_comment_nospell*
 Tex: Don't Want Spell Checking In Comments? ~

Some folks like to include things like source code in comments and so would
prefer that spell checking be disabled in comments in LaTeX files.  To do
this, put the following in your vimrc: >
      let g:tex_comment_nospell= 1
If you want to suppress spell checking everywhere inside your LaTeX document,
see |g:tex_nospell|.

				*tex-verb* *g:tex_verbspell*
 Tex: Want Spell Checking in Verbatim Zones?~

Often verbatim regions are used for things like source code; seldom does
one want source code spell-checked.  However, for those of you who do
want your verbatim zones spell-checked, put the following in your vimrc: >
	let g:tex_verbspell= 1
<
					*tex-runon* *tex-stopzone*
 Tex: Run-on Comments or MathZones ~

The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX.  The
highlighting supports three primary zones/regions: normal, texZone, and
texMathZone.  Although considerable effort has been made to have these zones
terminate properly, zones delineated by $..$ and $$..$$ cannot be synchronized
as there's no difference between start and end patterns.  Consequently, a
special "TeX comment" has been provided >
	%stopzone
which will forcibly terminate the highlighting of either a texZone or a
texMathZone.

					*tex-slow* *tex-sync*
 Tex: Slow Syntax Highlighting? ~

If you have a slow computer, you may wish to reduce the values for >
	:syn sync maxlines=200
	:syn sync minlines=50
(especially the latter).  If your computer is fast, you may wish to
increase them.	This primarily affects synchronizing (i.e. just what group,
if any, is the text at the top of the screen supposed to be in?).

Another cause of slow highlighting is due to syntax-driven folding; see
|tex-folding| for a way around this.

					*g:tex_fast*

Finally, if syntax highlighting is still too slow, you may set >

	:let g:tex_fast= ""

in your vimrc.  Used this way, the g:tex_fast variable causes the syntax
highlighting script to avoid defining any regions and associated
synchronization.  The result will be much faster syntax highlighting; the
price: you will no longer have as much highlighting or any syntax-based
folding, and you will be missing syntax-based error checking.

You may decide that some syntax is acceptable; you may use the following table
selectively to enable just some syntax highlighting: >

    b : allow bold and italic syntax
    c : allow texComment syntax
    m : allow texMatcher syntax (ie. {...} and [...])
    M : allow texMath syntax
    p : allow parts, chapter, section, etc syntax
    r : allow texRefZone syntax (nocite, bibliography, label, pageref, eqref)
    s : allow superscript/subscript regions
    S : allow texStyle syntax
    v : allow verbatim syntax
    V : allow texNewEnv and texNewCmd syntax
<
As an example, let g:tex_fast= "M" will allow math-associated highlighting
but suppress all the other region-based syntax highlighting.
(also see: |g:tex_conceal| and |tex-supersub|)

					*tex-morecommands* *tex-package*
 Tex: Want To Highlight More Commands? ~

LaTeX is a programmable language, and so there are thousands of packages full
of specialized LaTeX commands, syntax, and fonts.  If you're using such a
package you'll often wish that the distributed syntax/tex.vim would support
it.  However, clearly this is impractical.  So please consider using the
techniques in |mysyntaxfile-add| to extend or modify the highlighting provided
by syntax/tex.vim.

I've included some support for various popular packages on my website: >

	https://www.drchip.org/astronaut/vim/index.html#LATEXPKGS
<
The syntax files there go into your .../after/syntax/tex/

Title: TEX Syntax Highlighting Options: Spell Checking, Run-on Zones, Performance, and Custom Commands
Summary
This section describes various options for customizing TEX syntax highlighting in Vim. It covers how to disable spell checking globally or in comments, enable spell checking in verbatim zones, and terminate run-on comments or math zones. It also addresses performance issues, suggesting ways to reduce highlighting load on slower computers and providing options to selectively enable or disable different syntax elements for faster highlighting. Finally, it discusses how to highlight additional LaTeX commands from specialized packages.