comparison runtime/doc/syntax.txt @ 2535:31e51111bd14 vim73

Runtime file updates. Fix tar plugin window split.
author Bram Moolenaar <bram@vim.org>
date Tue, 10 Aug 2010 21:43:35 +0200
parents a89f8c036bc5
children 1851bce339fc
comparison
equal deleted inserted replaced
2534:e27def2ed69b 2535:31e51111bd14
1 *syntax.txt* For Vim version 7.3f. Last change: 2010 Aug 08 1 *syntax.txt* For Vim version 7.3f. Last change: 2010 Aug 10
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
2611 2611
2612 2612
2613 TEX *tex.vim* *ft-tex-syntax* 2613 TEX *tex.vim* *ft-tex-syntax*
2614 2614
2615 *tex-folding* 2615 *tex-folding*
2616 Want Syntax Folding? ~ 2616 Tex: Want Syntax Folding? ~
2617 2617
2618 As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters, 2618 As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters,
2619 sections, subsections, etc are supported. Put > 2619 sections, subsections, etc are supported. Put >
2620 let g:tex_fold_enabled=1 2620 let g:tex_fold_enabled=1
2621 in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a 2621 in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a
2622 modeline at the end of your LaTeX file: > 2622 modeline at the end of your LaTeX file: >
2623 % vim: fdm=syntax 2623 % vim: fdm=syntax
2624 < 2624 <
2625 *tex-nospell* 2625 *tex-nospell*
2626 Don't Want Spell Checking In Comments? ~ 2626 Tex: Don't Want Spell Checking In Comments? ~
2627 2627
2628 Some folks like to include things like source code in comments and so would 2628 Some folks like to include things like source code in comments and so would
2629 prefer that spell checking be disabled in comments in LaTeX files. To do 2629 prefer that spell checking be disabled in comments in LaTeX files. To do
2630 this, put the following in your <.vimrc>: > 2630 this, put the following in your <.vimrc>: >
2631 let g:tex_comment_nospell= 1 2631 let g:tex_comment_nospell= 1
2632 < 2632 <
2633 *tex-verb* 2633 *tex-verb*
2634 Want Spell Checking in Verbatim Zones?~ 2634 Tex: Want Spell Checking in Verbatim Zones?~
2635 2635
2636 Often verbatim regions are used for things like source code; seldom does 2636 Often verbatim regions are used for things like source code; seldom does
2637 one want source code spell-checked. However, for those of you who do 2637 one want source code spell-checked. However, for those of you who do
2638 want your verbatim zones spell-checked, put the following in your <.vimrc>: > 2638 want your verbatim zones spell-checked, put the following in your <.vimrc>: >
2639 let g:tex_verbspell= 1 2639 let g:tex_verbspell= 1
2640 2640 <
2641 *tex-runon* 2641 *tex-runon*
2642 Run-on Comments/Math? ~ 2642 Tex: Run-on Comments or MathZones ~
2643 2643
2644 The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The 2644 The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The
2645 highlighting supports three primary zones/regions: normal, texZone, and 2645 highlighting supports three primary zones/regions: normal, texZone, and
2646 texMathZone. Although considerable effort has been made to have these zones 2646 texMathZone. Although considerable effort has been made to have these zones
2647 terminate properly, zones delineated by $..$ and $$..$$ cannot be synchronized 2647 terminate properly, zones delineated by $..$ and $$..$$ cannot be synchronized
2650 %stopzone 2650 %stopzone
2651 which will forcibly terminate the highlighting of either a texZone or a 2651 which will forcibly terminate the highlighting of either a texZone or a
2652 texMathZone. 2652 texMathZone.
2653 2653
2654 *tex-slow* 2654 *tex-slow*
2655 Slow Syntax Highlighting? ~ 2655 Tex: Slow Syntax Highlighting? ~
2656 2656
2657 If you have a slow computer, you may wish to reduce the values for > 2657 If you have a slow computer, you may wish to reduce the values for >
2658 :syn sync maxlines=200 2658 :syn sync maxlines=200
2659 :syn sync minlines=50 2659 :syn sync minlines=50
2660 (especially the latter). If your computer is fast, you may wish to 2660 (especially the latter). If your computer is fast, you may wish to
2661 increase them. This primarily affects synchronizing (i.e. just what group, 2661 increase them. This primarily affects synchronizing (i.e. just what group,
2662 if any, is the text at the top of the screen supposed to be in?). 2662 if any, is the text at the top of the screen supposed to be in?).
2663 2663
2664 *tex-morecommands* *tex-package* 2664 *tex-morecommands* *tex-package*
2665 Want To Highlight More Commands? ~ 2665 Tex: Want To Highlight More Commands? ~
2666 2666
2667 LaTeX is a programmable language, and so there are thousands of packages full 2667 LaTeX is a programmable language, and so there are thousands of packages full
2668 of specialized LaTeX commands, syntax, and fonts. If you're using such a 2668 of specialized LaTeX commands, syntax, and fonts. If you're using such a
2669 package you'll often wish that the distributed syntax/tex.vim would support 2669 package you'll often wish that the distributed syntax/tex.vim would support
2670 it. However, clearly this is impractical. So please consider using the 2670 it. However, clearly this is impractical. So please consider using the
2671 techniques in |mysyntaxfile-add| to extend or modify the highlighting provided 2671 techniques in |mysyntaxfile-add| to extend or modify the highlighting provided
2672 by syntax/tex.vim. 2672 by syntax/tex.vim.
2673 2673
2674 *tex-error* 2674 *tex-error*
2675 Excessive Error Highlighting? ~ 2675 Tex: Excessive Error Highlighting? ~
2676 2676
2677 The <tex.vim> supports lexical error checking of various sorts. Thus, 2677 The <tex.vim> supports lexical error checking of various sorts. Thus,
2678 although the error checking is ofttimes very useful, it can indicate 2678 although the error checking is ofttimes very useful, it can indicate
2679 errors where none actually are. If this proves to be a problem for you, 2679 errors where none actually are. If this proves to be a problem for you,
2680 you may put in your <.vimrc> the following statement: > 2680 you may put in your <.vimrc> the following statement: >
2681 let tex_no_error=1 2681 let tex_no_error=1
2682 and all error checking by <syntax/tex.vim> will be suppressed. 2682 and all error checking by <syntax/tex.vim> will be suppressed.
2683 2683
2684 *tex-math* 2684 *tex-math*
2685 Need a new Math Group? ~ 2685 Tex: Need a new Math Group? ~
2686 2686
2687 If you want to include a new math group in your LaTeX, the following 2687 If you want to include a new math group in your LaTeX, the following
2688 code shows you an example as to how you might do so: > 2688 code shows you an example as to how you might do so: >
2689 call TexNewMathZone(sfx,mathzone,starform) 2689 call TexNewMathZone(sfx,mathzone,starform)
2690 You'll want to provide the new math group with a unique suffix 2690 You'll want to provide the new math group with a unique suffix
2695 and then to the call to it in .vim/after/syntax/tex.vim. 2695 and then to the call to it in .vim/after/syntax/tex.vim.
2696 The "starform" variable, if true, implies that your new math group 2696 The "starform" variable, if true, implies that your new math group
2697 has a starred form (ie. eqnarray*). 2697 has a starred form (ie. eqnarray*).
2698 2698
2699 *tex-style* 2699 *tex-style*
2700 Starting a New Style? ~ 2700 Tex: Starting a New Style? ~
2701 2701
2702 One may use "\makeatletter" in *.tex files, thereby making the use of "@" in 2702 One may use "\makeatletter" in *.tex files, thereby making the use of "@" in
2703 commands available. However, since the *.tex file doesn't have one of the 2703 commands available. However, since the *.tex file doesn't have one of the
2704 following suffices: sty cls clo dtx ltx, the syntax highlighting will flag 2704 following suffices: sty cls clo dtx ltx, the syntax highlighting will flag
2705 such use of @ as an error. To solve this: > 2705 such use of @ as an error. To solve this: >
2709 2709
2710 Putting "let g:tex_stylish=1" into your <.vimrc> will make <syntax/tex.vim> 2710 Putting "let g:tex_stylish=1" into your <.vimrc> will make <syntax/tex.vim>
2711 always accept such use of @. 2711 always accept such use of @.
2712 2712
2713 *tex-cchar* *tex-cole* *tex-conceal* 2713 *tex-cchar* *tex-cole* *tex-conceal*
2714 Taking Advantage of Conceal Mode~ 2714 Tex: Taking Advantage of Conceal Mode~
2715 2715
2716 If you have |'conceallevel'| set to 2 and if your encoding is utf-8, then a 2716 If you have |'conceallevel'| set to 2 and if your encoding is utf-8, then a
2717 number of character sequences can be translated into appropriate utf-8 glyphs, 2717 number of character sequences can be translated into appropriate utf-8 glyphs,
2718 including various accented characters, Greek characters in MathZones, and 2718 including various accented characters, Greek characters in MathZones, and
2719 superscripts and subscripts in MathZones. Not all characters can be made into 2719 superscripts and subscripts in MathZones. Not all characters can be made into
2720 superscripts or subscripts; the constraint is due to what utf-8 supports. 2720 superscripts or subscripts; the constraint is due to what utf-8 supports.
2721 In fact, only a few characters are supported as subscripts. 2721 In fact, only a few characters are supported as subscripts.
2722 2722
2723 One way to use this is to have vertically split windows (see |CTRL-W_v|); one 2723 One way to use this is to have vertically split windows (see |CTRL-W_v|); one
2724 with |'conceallevel'| at 0 and the other at 2; and both using |'scrollbind'|. 2724 with |'conceallevel'| at 0 and the other at 2; and both using |'scrollbind'|.
2725
2726 *g:tex_conceal*
2727 Tex: Selective Conceal Mode~
2728
2729 You may selectively use conceal mode by setting g:tex_conceal in your
2730 <.vimrc>. By default it is set to "admgs" to enable conceal for the
2731 following sets of characters: >
2732
2733 a = accents/ligatures
2734 d = delimiters
2735 m = math symbols
2736 g = Greek
2737 s = superscripts/subscripts
2738 <
2739 By leaving one or more of these out, the associated conceal-character
2740 substitution will not be made.
2725 2741
2726 2742
2727 TF *tf.vim* *ft-tf-syntax* 2743 TF *tf.vim* *ft-tf-syntax*
2728 2744
2729 There is one option for the tf syntax highlighting. 2745 There is one option for the tf syntax highlighting.