Mercurial > vim
comparison runtime/doc/syntax.txt @ 477:f8b75b8f1988
updated for version 7.0128
author | vimboss |
---|---|
date | Thu, 11 Aug 2005 20:09:58 +0000 |
parents | 3709cf52b9b5 |
children | 66080ac5dab7 |
comparison
equal
deleted
inserted
replaced
476:a6c13cc11da9 | 477:f8b75b8f1988 |
---|---|
1 *syntax.txt* For Vim version 7.0aa. Last change: 2005 Jul 29 | 1 *syntax.txt* For Vim version 7.0aa. Last change: 2005 Aug 11 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
397 :let html_number_lines = 0 | 397 :let html_number_lines = 0 |
398 Go back to the default to use 'number' by deleting the variable: > | 398 Go back to the default to use 'number' by deleting the variable: > |
399 :unlet html_number_lines | 399 :unlet html_number_lines |
400 | 400 |
401 Closed folds are put in the HTML as they are displayed. If you don't want | 401 Closed folds are put in the HTML as they are displayed. If you don't want |
402 this, use the "zR" command before invoking 2html, or use: > | 402 this, use the |zR| command before invoking 2html, or use: > |
403 :let html_ignore_folding = 1 | 403 :let html_ignore_folding = 1 |
404 | 404 |
405 By default, HTML optimized for old browsers is generated. If you prefer using | 405 By default, HTML optimized for old browsers is generated. If you prefer using |
406 cascading style sheets (CSS1) for the attributes (resulting in considerably | 406 cascading style sheets (CSS1) for the attributes (resulting in considerably |
407 shorter and valid HTML 4 file), use: > | 407 shorter and valid HTML 4 file), use: > |
424 :let html_use_encoding = "" | 424 :let html_use_encoding = "" |
425 To go back to the automatic mechanism, delete the g:html_use_encoding | 425 To go back to the automatic mechanism, delete the g:html_use_encoding |
426 variable: > | 426 variable: > |
427 :unlet html_use_encoding | 427 :unlet html_use_encoding |
428 < | 428 < |
429 Closed folds are kept as they are displayed. If you don't want closed folds | |
430 in the HTML use the |zR| command before converting. | |
431 | |
432 For diff mode a sequence of more than 3 filler lines is displayed as three | 429 For diff mode a sequence of more than 3 filler lines is displayed as three |
433 lines with the middle line mentioning the total number of inserted lines. If | 430 lines with the middle line mentioning the total number of inserted lines. If |
434 you prefer to see all the inserted lines use: > | 431 you prefer to see all the inserted lines use: > |
435 :let html_whole_filler = 1 | 432 :let html_whole_filler = 1 |
436 And to go back to displaying up to three lines again: > | 433 And to go back to displaying up to three lines again: > |
437 :unlet html_whole_filler | 434 :unlet html_whole_filler |
438 | 435 < |
439 *convert-to-XML* *convert-to-XHTML* | 436 *convert-to-XML* *convert-to-XHTML* |
440 An alternative is to have the script generate XHTML (XML compliant HTML). To | 437 An alternative is to have the script generate XHTML (XML compliant HTML). To |
441 do this set the "use_xhtml" variable: > | 438 do this set the "use_xhtml" variable: > |
442 :let use_xhtml = 1 | 439 :let use_xhtml = 1 |
443 To disable it again delete the variable: > | 440 To disable it again delete the variable: > |
2353 number is that redrawing can become slow. | 2350 number is that redrawing can become slow. |
2354 | 2351 |
2355 | 2352 |
2356 TEX *tex.vim* *tex-syntax* | 2353 TEX *tex.vim* *tex-syntax* |
2357 | 2354 |
2355 *tex-folding* | |
2356 Want Syntax Folding? ~ | |
2357 | |
2358 As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters, | |
2359 sections, subsections, etc are supported. Put > | |
2360 let g:tex_fold_enabled=1 | |
2361 in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a | |
2362 modeline at the end of your LaTeX file: > | |
2363 % vim: fdm=syntax | |
2364 < | |
2365 *tex-runon* | |
2358 Run-on Comments/Math? ~ | 2366 Run-on Comments/Math? ~ |
2359 | 2367 |
2360 The tex highlighting supports TeX, LaTeX, and some AmsTeX. The | 2368 The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The |
2361 highlighting supports three primary zones: normal, texZone, and texMathZone. | 2369 highlighting supports three primary zones/regions: normal, texZone, and |
2362 Although a considerable effort has been made to have these zones terminate | 2370 texMathZone. Although considerable effort has been made to have these zones |
2363 properly, zones delineated by $..$ and $$..$$ cannot be synchronized as | 2371 terminate properly, zones delineated by $..$ and $$..$$ cannot be synchronized |
2364 there's no difference between start and end patterns. Consequently, a | 2372 as there's no difference between start and end patterns. Consequently, a |
2365 special "TeX comment" has been provided > | 2373 special "TeX comment" has been provided > |
2366 %stopzone | 2374 %stopzone |
2367 which will forcibly terminate the highlighting of either a texZone or a | 2375 which will forcibly terminate the highlighting of either a texZone or a |
2368 texMathZone. | 2376 texMathZone. |
2369 | 2377 |
2378 *tex-slow* | |
2370 Slow Syntax Highlighting? ~ | 2379 Slow Syntax Highlighting? ~ |
2371 | 2380 |
2372 If you have a slow computer, you may wish to reduce the values for > | 2381 If you have a slow computer, you may wish to reduce the values for > |
2373 :syn sync maxlines=200 | 2382 :syn sync maxlines=200 |
2374 :syn sync minlines=50 | 2383 :syn sync minlines=50 |
2375 (especially the latter). If your computer is fast, you may wish to | 2384 (especially the latter). If your computer is fast, you may wish to |
2376 increase them. This primarily affects synchronizing (i.e. just what group, | 2385 increase them. This primarily affects synchronizing (i.e. just what group, |
2377 if any, is the text at the top of the screen supposed to be in?). | 2386 if any, is the text at the top of the screen supposed to be in?). |
2378 | 2387 |
2388 *tex-error* | |
2379 Excessive Error Highlighting? ~ | 2389 Excessive Error Highlighting? ~ |
2380 | 2390 |
2381 The <tex.vim> supports lexical error checking of various sorts. Thus, | 2391 The <tex.vim> supports lexical error checking of various sorts. Thus, |
2382 although the error checking is ofttimes very useful, it can indicate | 2392 although the error checking is ofttimes very useful, it can indicate |
2383 errors where none actually are. If this proves to be a problem for you, | 2393 errors where none actually are. If this proves to be a problem for you, |
2384 you may put in your <.vimrc> the following statement: > | 2394 you may put in your <.vimrc> the following statement: > |
2385 let tex_no_error=1 | 2395 let tex_no_error=1 |
2386 and all error checking by <tex.vim> will be suppressed. | 2396 and all error checking by <syntax/tex.vim> will be suppressed. |
2387 | 2397 |
2398 *tex-math* | |
2388 Need a new Math Group? ~ | 2399 Need a new Math Group? ~ |
2389 | 2400 |
2390 If you want to include a new math group in your LaTeX, the following | 2401 If you want to include a new math group in your LaTeX, the following |
2391 code shows you an example as to how you might do so: > | 2402 code shows you an example as to how you might do so: > |
2392 | 2403 call TexNewMathZone(sfx,mathzone,starform) |
2393 syn cluster texMathZones add=texMathZoneLOCAL | 2404 You'll want to provide the new math group with a unique suffix |
2394 syn region texMathZoneLOCAL start="\\begin\s*{\s*LOCALMATH\s*}" | 2405 (currently, A-L and V-Z are taken by <syntax/tex.vim> itself). |
2395 \ end="\\end\s*{\s*LOCALMATH\s*}" keepend | 2406 As an example, consider how eqnarray is set up by <syntax/tex.vim>: > |
2396 \ contains=@texMathZoneGroup | 2407 call TexNewMathZone("D","eqnarray",1) |
2397 if !exists("tex_no_math") | 2408 You'll need to change "mathzone" to the name of your new math group, |
2398 syn sync match texSyncMathZoneLOCAL grouphere texMathZoneLOCAL | 2409 and then to the call to it in .vim/after/syntax/tex.vim. |
2399 \ "\\begin\s*{\s*LOCALMATH\*\s*}" | 2410 The "starform" variable, if true, implies that your new math group |
2400 syn sync match texSyncMathZoneLOCAL groupthere NONE | 2411 has a starred form (ie. eqnarray*). |
2401 \ "\\end\s*{\s*LOCALMATH\*\s*}" | 2412 |
2402 endif | 2413 *tex-style* |
2403 hi link texMathZoneLOCAL texMath | |
2404 < | |
2405 You'll need to change LOCALMATH to the name of your new math group, | |
2406 and then to put it into .vim/after/syntax/tex.vim. | |
2407 | |
2408 Starting a New Style? ~ | 2414 Starting a New Style? ~ |
2409 | 2415 |
2410 One may use "\makeatletter" in *.tex files, thereby making the use of "@" in | 2416 One may use "\makeatletter" in *.tex files, thereby making the use of "@" in |
2411 commands available. However, since the *.tex file doesn't have one of the | 2417 commands available. However, since the *.tex file doesn't have one of the |
2412 following suffices: sty cls clo dtx ltx, the syntax highlighting will flag | 2418 following suffices: sty cls clo dtx ltx, the syntax highlighting will flag |