Mercurial > vim
comparison runtime/doc/syntax.txt @ 1125:96cd8222a819
updated for version 7.1a
author | vimboss |
---|---|
date | Sat, 05 May 2007 18:24:42 +0000 |
parents | 4bac29d27e2f |
children | edc1c9d6dab9 |
comparison
equal
deleted
inserted
replaced
1124:da2a955f150a | 1125:96cd8222a819 |
---|---|
1 *syntax.txt* For Vim version 7.0. Last change: 2006 Apr 30 | 1 *syntax.txt* For Vim version 7.1a. Last change: 2007 May 03 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
465 Variable Highlight ~ | 465 Variable Highlight ~ |
466 abel_obsolete_ok obsolete keywords are statements, not errors | 466 abel_obsolete_ok obsolete keywords are statements, not errors |
467 abel_cpp_comments_illegal do not interpret '//' as inline comment leader | 467 abel_cpp_comments_illegal do not interpret '//' as inline comment leader |
468 | 468 |
469 | 469 |
470 ADA *ada.vim* *ft-ada-syntax* | 470 ADA |
471 | 471 |
472 This mode is designed for the 1995 edition of Ada ("Ada95"), which | 472 See |ft-ada-syntax| |
473 includes support for objected-programming, protected types, and so on. | |
474 It handles code written for the original Ada language | |
475 ("Ada83" or "Ada87") as well, though Ada83 code which uses Ada95-only | |
476 keywords will be wrongly colored (such code should be fixed anyway). | |
477 For more information about Ada, see http://www.adapower.com. | |
478 | |
479 The Ada mode handles a number of situations cleanly. | |
480 For example, it knows that the "-" in "-5" is a number, but the same | |
481 character in "A-5" is an operator. Normally, a "with" or "use" clause | |
482 referencing another compilation unit is colored the same way as C's | |
483 "#include" is colored. If you have "Conditional" or "Repeat" | |
484 groups colored differently, then "end if" and "end loop" will be | |
485 colored as part of those respective groups. | |
486 You can set these to different colors using vim's "highlight" command | |
487 (e.g., to change how loops are displayed, enter the command | |
488 ":hi Repeat" followed by the color specification; on simple terminals | |
489 the color specification ctermfg=White often shows well). | |
490 | |
491 There are several options you can select in this Ada mode. | |
492 To enable them, assign a value to the option. For example, to turn one on: | |
493 let ada_standard_types = 1 | |
494 To disable them use ":unlet". Example: | |
495 unlet ada_standard_types = 1 | |
496 You can just use ":" and type these into the command line to set these | |
497 temporarily before loading an Ada file. You can make these option settings | |
498 permanent by adding the "let" command(s), without a colon, | |
499 to your "~/.vimrc" file. | |
500 | |
501 Here are the Ada mode options: | |
502 | |
503 Variable Action ~ | |
504 ada_standard_types Highlight types in package Standard (e.g., "Float") | |
505 ada_space_errors Highlight extraneous errors in spaces... | |
506 ada_no_trail_space_error but ignore trailing spaces at the end of a line | |
507 ada_no_tab_space_error but ignore tabs after spaces | |
508 ada_withuse_ordinary Show "with" and "use" as ordinary keywords | |
509 (when used to reference other compilation units | |
510 they're normally highlighted specially). | |
511 ada_begin_preproc Show all begin-like keywords using the coloring | |
512 of C preprocessor commands. | |
513 | |
514 Even on a slow (90Mhz) PC this mode works quickly, but if you find | |
515 the performance unacceptable, turn on ada_withuse_ordinary. | |
516 | 473 |
517 | 474 |
518 ANT *ant.vim* *ft-ant-syntax* | 475 ANT *ant.vim* *ft-ant-syntax* |
519 | 476 |
520 The ant syntax file provides syntax highlighting for javascript and python | 477 The ant syntax file provides syntax highlighting for javascript and python |
901 or in a modeline by appending '.doxygen' to the syntax of the file. Example: > | 858 or in a modeline by appending '.doxygen' to the syntax of the file. Example: > |
902 :set syntax=c.doxygen | 859 :set syntax=c.doxygen |
903 or > | 860 or > |
904 // vim:syntax=c.doxygen | 861 // vim:syntax=c.doxygen |
905 | 862 |
906 To use doxygen formatting on top of any filetype, add the following to your | |
907 .vimrc for each filetype, replacing {filetype} with the relevent value. > | |
908 :let g:syntax_extra_{filetype}='doxygen' | |
909 | |
910 It can also be done automaticly for c, cpp and idl files by setting the global | 863 It can also be done automaticly for c, cpp and idl files by setting the global |
911 or buffer-local variable load_doxygen_syntax. This is done by adding the | 864 or buffer-local variable load_doxygen_syntax. This is done by adding the |
912 following to your .vimrc. > | 865 following to your .vimrc. > |
913 :let g:load_doxygen_syntax=1 | 866 :let g:load_doxygen_syntax=1 |
914 | 867 |
2337 | 2290 |
2338 :let ruby_fold = 1 | 2291 :let ruby_fold = 1 |
2339 | 2292 |
2340 This will set the 'foldmethod' option to "syntax" and allow folding of | 2293 This will set the 'foldmethod' option to "syntax" and allow folding of |
2341 classes, modules, methods, code blocks, heredocs and comments. | 2294 classes, modules, methods, code blocks, heredocs and comments. |
2295 | |
2296 | |
2342 SCHEME *scheme.vim* *ft-scheme-syntax* | 2297 SCHEME *scheme.vim* *ft-scheme-syntax* |
2343 | 2298 |
2344 By default only R5RS keywords are highlighted and properly indented. | 2299 By default only R5RS keywords are highlighted and properly indented. |
2345 | 2300 |
2346 MzScheme-specific stuff will be used if b:is_mzscheme or g:is_mzscheme | 2301 MzScheme-specific stuff will be used if b:is_mzscheme or g:is_mzscheme |
2595 :syn sync maxlines=200 | 2550 :syn sync maxlines=200 |
2596 :syn sync minlines=50 | 2551 :syn sync minlines=50 |
2597 (especially the latter). If your computer is fast, you may wish to | 2552 (especially the latter). If your computer is fast, you may wish to |
2598 increase them. This primarily affects synchronizing (i.e. just what group, | 2553 increase them. This primarily affects synchronizing (i.e. just what group, |
2599 if any, is the text at the top of the screen supposed to be in?). | 2554 if any, is the text at the top of the screen supposed to be in?). |
2555 | |
2556 *tex-morecommands* *tex-package* | |
2557 Wish To Highlight More Commmands? ~ | |
2558 | |
2559 LaTeX is a programmable language, and so there are thousands of packages full | |
2560 of specialized LaTeX commands, syntax, and fonts. If you're using such a | |
2561 package you'll often wish that the distributed syntax/tex.vim would support | |
2562 it. However, clearly this is impractical. So please consider using the | |
2563 techniques in |mysyntaxfile-add| to extend or modify the highlighting provided | |
2564 by syntax/tex.vim. | |
2600 | 2565 |
2601 *tex-error* | 2566 *tex-error* |
2602 Excessive Error Highlighting? ~ | 2567 Excessive Error Highlighting? ~ |
2603 | 2568 |
2604 The <tex.vim> supports lexical error checking of various sorts. Thus, | 2569 The <tex.vim> supports lexical error checking of various sorts. Thus, |
4394 Put these lines in your Makefile: | 4359 Put these lines in your Makefile: |
4395 | 4360 |
4396 # Make a highlight file for types. Requires Exuberant ctags and awk | 4361 # Make a highlight file for types. Requires Exuberant ctags and awk |
4397 types: types.vim | 4362 types: types.vim |
4398 types.vim: *.[ch] | 4363 types.vim: *.[ch] |
4399 ctags -i=gstuS -o- *.[ch] |\ | 4364 ctags --c-kinds=gstu -o- *.[ch] |\ |
4400 awk 'BEGIN{printf("syntax keyword Type\t")}\ | 4365 awk 'BEGIN{printf("syntax keyword Type\t")}\ |
4401 {printf("%s ", $$1)}END{print ""}' > $@ | 4366 {printf("%s ", $$1)}END{print ""}' > $@ |
4402 | 4367 |
4403 And put these lines in your .vimrc: > | 4368 And put these lines in your .vimrc: > |
4404 | 4369 |
4502 XTerm*color15: #ffffff | 4467 XTerm*color15: #ffffff |
4503 Xterm*cursorColor: Black | 4468 Xterm*cursorColor: Black |
4504 | 4469 |
4505 [Note: The cursorColor is required to work around a bug, which changes the | 4470 [Note: The cursorColor is required to work around a bug, which changes the |
4506 cursor color to the color of the last drawn text. This has been fixed by a | 4471 cursor color to the color of the last drawn text. This has been fixed by a |
4507 newer version of xterm, but not everybody is it using yet.] | 4472 newer version of xterm, but not everybody is using it yet.] |
4508 | 4473 |
4509 To get these right away, reload the .Xdefaults file to the X Option database | 4474 To get these right away, reload the .Xdefaults file to the X Option database |
4510 Manager (you only need to do this when you just changed the .Xdefaults file): > | 4475 Manager (you only need to do this when you just changed the .Xdefaults file): > |
4511 xrdb -merge ~/.Xdefaults | 4476 xrdb -merge ~/.Xdefaults |
4512 < | 4477 < |
4518 XTerm*cursorOnTime: 400 | 4483 XTerm*cursorOnTime: 400 |
4519 XTerm*cursorOffTime: 250 | 4484 XTerm*cursorOffTime: 250 |
4520 XTerm*cursorColor: White | 4485 XTerm*cursorColor: White |
4521 | 4486 |
4522 *hpterm-color* | 4487 *hpterm-color* |
4523 These settings work (more or less) for a hpterm, which only supports 8 | 4488 These settings work (more or less) for an hpterm, which only supports 8 |
4524 foreground colors: > | 4489 foreground colors: > |
4525 :if has("terminfo") | 4490 :if has("terminfo") |
4526 : set t_Co=8 | 4491 : set t_Co=8 |
4527 : set t_Sf=<Esc>[&v%p1%dS | 4492 : set t_Sf=<Esc>[&v%p1%dS |
4528 : set t_Sb=<Esc>[&v7S | 4493 : set t_Sb=<Esc>[&v7S |