comparison runtime/doc/syntax.txt @ 10186:a5ef9968638c

commit https://github.com/vim/vim/commit/7e1479b86c590a66b63a274c079b7f18907d45a4 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 11 15:07:27 2016 +0200 Updated runtime files, Japanese translations.
author Christian Brabandt <cb@256bit.org>
date Sun, 11 Sep 2016 15:15:07 +0200
parents b4da19b7539f
children 9f48eab77d62
comparison
equal deleted inserted replaced
10185:a93cbcaeb4bb 10186:a5ef9968638c
1 *syntax.txt* For Vim version 7.4. Last change: 2016 Aug 16 1 *syntax.txt* For Vim version 7.4. Last change: 2016 Sep 09
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
2667 :let g:filetype_r = "r" 2667 :let g:filetype_r = "r"
2668 2668
2669 2669
2670 RUBY *ruby.vim* *ft-ruby-syntax* 2670 RUBY *ruby.vim* *ft-ruby-syntax*
2671 2671
2672 There are a number of options to the Ruby syntax highlighting. 2672 Ruby: Operator highlighting |ruby_operators|
2673 Ruby: Whitespace errors |ruby_space_errors|
2674 Ruby: Folding |ruby_fold| |ruby_foldable_groups|
2675 Ruby: Reducing expensive operations |ruby_no_expensive| |ruby_minlines|
2676 Ruby: Spellchecking strings |ruby_spellcheck_strings|
2677
2678 *ruby_operators*
2679 Ruby: Operator highlighting ~
2680
2681 Operators can be highlighted by defining "ruby_operators": >
2682
2683 :let ruby_operators = 1
2684 <
2685 *ruby_space_errors*
2686 Ruby: Whitespace errors ~
2687
2688 Whitespace errors can be highlighted by defining "ruby_space_errors": >
2689
2690 :let ruby_space_errors = 1
2691 <
2692 This will highlight trailing whitespace and tabs preceded by a space character
2693 as errors. This can be refined by defining "ruby_no_trail_space_error" and
2694 "ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
2695 spaces respectively.
2696
2697 *ruby_fold* *ruby_foldable_groups*
2698 Ruby: Folding ~
2699
2700 Folding can be enabled by defining "ruby_fold": >
2701
2702 :let ruby_fold = 1
2703 <
2704 This will set the value of 'foldmethod' to "syntax" locally to the current
2705 buffer or window, which will enable syntax-based folding when editing Ruby
2706 filetypes.
2707
2708 *ruby_foldable_groups*
2709 Default folding is rather detailed, i.e., small syntax units like "if", "do",
2710 "%w[]" may create corresponding fold levels.
2711
2712 You can set "ruby_foldable_groups" to restrict which groups are foldable: >
2713
2714 :let ruby_foldable_groups = 'if case %'
2715 <
2716 The value is a space-separated list of keywords:
2717
2718 keyword meaning ~
2719 -------- ------------------------------------- ~
2720 ALL Most block syntax (default)
2721 NONE Nothing
2722 if "if" or "unless" block
2723 def "def" block
2724 class "class" block
2725 module "module" block
2726 do "do" block
2727 begin "begin" block
2728 case "case" block
2729 for "for", "while", "until" loops
2730 { Curly bracket block or hash literal
2731 [ Array literal
2732 % Literal with "%" notation, e.g.: %w(STRING), %!STRING!
2733 / Regexp
2734 string String and shell command output (surrounded by ', ", `)
2735 : Symbol
2736 # Multiline comment
2737 << Here documents
2738 __END__ Source code after "__END__" directive
2739
2740 *ruby_no_expensive*
2741 Ruby: Reducing expensive operations ~
2673 2742
2674 By default, the "end" keyword is colorized according to the opening statement 2743 By default, the "end" keyword is colorized according to the opening statement
2675 of the block it closes. While useful, this feature can be expensive; if you 2744 of the block it closes. While useful, this feature can be expensive; if you
2676 experience slow redrawing (or you are on a terminal with poor color support) 2745 experience slow redrawing (or you are on a terminal with poor color support)
2677 you may want to turn it off by defining the "ruby_no_expensive" variable: > 2746 you may want to turn it off by defining the "ruby_no_expensive" variable: >
2678 2747
2679 :let ruby_no_expensive = 1 2748 :let ruby_no_expensive = 1
2680 < 2749 <
2681 In this case the same color will be used for all control keywords. 2750 In this case the same color will be used for all control keywords.
2682 2751
2752 *ruby_minlines*
2753
2683 If you do want this feature enabled, but notice highlighting errors while 2754 If you do want this feature enabled, but notice highlighting errors while
2684 scrolling backwards, which are fixed when redrawing with CTRL-L, try setting 2755 scrolling backwards, which are fixed when redrawing with CTRL-L, try setting
2685 the "ruby_minlines" variable to a value larger than 50: > 2756 the "ruby_minlines" variable to a value larger than 50: >
2686 2757
2687 :let ruby_minlines = 100 2758 :let ruby_minlines = 100
2688 < 2759 <
2689 Ideally, this value should be a number of lines large enough to embrace your 2760 Ideally, this value should be a number of lines large enough to embrace your
2690 largest class or module. 2761 largest class or module.
2691 2762
2692 Highlighting of special identifiers can be disabled by removing the 2763 *ruby_spellcheck_strings*
2693 rubyIdentifier highlighting: > 2764 Ruby: Spellchecking strings ~
2694 2765
2695 :hi link rubyIdentifier NONE 2766 Ruby syntax will perform spellchecking of strings if you define
2696 < 2767 "ruby_spellcheck_strings": >
2697 This will prevent highlighting of special identifiers like "ConstantName", 2768
2698 "$global_var", "@@class_var", "@instance_var", "| block_param |", and 2769 :let ruby_spellcheck_strings = 1
2699 ":symbol".
2700
2701 Significant methods of Kernel, Module and Object are highlighted by default.
2702 This can be disabled by defining "ruby_no_special_methods": >
2703
2704 :let ruby_no_special_methods = 1
2705 <
2706 This will prevent highlighting of important methods such as "require", "attr",
2707 "private", "raise" and "proc".
2708
2709 Ruby operators can be highlighted. This is enabled by defining
2710 "ruby_operators": >
2711
2712 :let ruby_operators = 1
2713 <
2714 Whitespace errors can be highlighted by defining "ruby_space_errors": >
2715
2716 :let ruby_space_errors = 1
2717 <
2718 This will highlight trailing whitespace and tabs preceded by a space character
2719 as errors. This can be refined by defining "ruby_no_trail_space_error" and
2720 "ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
2721 spaces respectively.
2722
2723 Folding can be enabled by defining "ruby_fold": >
2724
2725 :let ruby_fold = 1
2726 <
2727 This will set the 'foldmethod' option to "syntax" and allow folding of
2728 classes, modules, methods, code blocks, heredocs and comments.
2729
2730 Folding of multiline comments can be disabled by defining
2731 "ruby_no_comment_fold": >
2732
2733 :let ruby_no_comment_fold = 1
2734 < 2770 <
2735 2771
2736 SCHEME *scheme.vim* *ft-scheme-syntax* 2772 SCHEME *scheme.vim* *ft-scheme-syntax*
2737 2773
2738 By default only R5RS keywords are highlighted and properly indented. 2774 By default only R5RS keywords are highlighted and properly indented.