|
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 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -2669,68 +2669,104 @@ your .vimrc: *g:filetype_r* |
2669 | 2669 |
|
2670 | 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| |
2673 | 2677 |
|
2674 | | -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 |
2676 | | -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: > |
| 2678 | + *ruby_operators* |
| 2679 | + Ruby: Operator highlighting ~ |
2678 | 2680 |
|
2679 | | - :let ruby_no_expensive = 1 |
| 2681 | +Operators can be highlighted by defining "ruby_operators": > |
| 2682 | +
|
| 2683 | + :let ruby_operators = 1 |
2680 | 2684 | < |
2681 | | -In this case the same color will be used for all control keywords. |
| 2685 | + *ruby_space_errors* |
| 2686 | + Ruby: Whitespace errors ~ |
2682 | 2687 |
|
2683 | | -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 |
2685 | | -the "ruby_minlines" variable to a value larger than 50: > |
| 2688 | +Whitespace errors can be highlighted by defining "ruby_space_errors": > |
2686 | 2689 |
|
2687 | | - :let ruby_minlines = 100 |
| 2690 | + :let ruby_space_errors = 1 |
2688 | 2691 | < |
2689 | | -Ideally, this value should be a number of lines large enough to embrace your |
2690 | | -largest class or module. |
| 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 ~ |
2691 | 2699 |
|
2692 | | -Highlighting of special identifiers can be disabled by removing the |
2693 | | -rubyIdentifier highlighting: > |
| 2700 | +Folding can be enabled by defining "ruby_fold": > |
2694 | 2701 |
|
2695 | | - :hi link rubyIdentifier NONE |
| 2702 | + :let ruby_fold = 1 |
2696 | 2703 | < |
2697 | | -This will prevent highlighting of special identifiers like "ConstantName", |
2698 | | -"$global_var", "@@class_var", "@instance_var", "| block_param |", and |
2699 | | -":symbol". |
| 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. |
2700 | 2711 |
|
2701 | | -Significant methods of Kernel, Module and Object are highlighted by default. |
2702 | | -This can be disabled by defining "ruby_no_special_methods": > |
| 2712 | +You can set "ruby_foldable_groups" to restrict which groups are foldable: > |
2703 | 2713 |
|
2704 | | - :let ruby_no_special_methods = 1 |
| 2714 | + :let ruby_foldable_groups = 'if case %' |
2705 | 2715 | < |
2706 | | -This will prevent highlighting of important methods such as "require", "attr", |
2707 | | -"private", "raise" and "proc". |
| 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 ~ |
2708 | 2742 |
|
2709 | | -Ruby operators can be highlighted. This is enabled by defining |
2710 | | -"ruby_operators": > |
| 2743 | +By default, the "end" keyword is colorized according to the opening statement |
| 2744 | +of the block it closes. While useful, this feature can be expensive; if you |
| 2745 | +experience slow redrawing (or you are on a terminal with poor color support) |
| 2746 | +you may want to turn it off by defining the "ruby_no_expensive" variable: > |
2711 | 2747 |
|
2712 | | - :let ruby_operators = 1 |
| 2748 | + :let ruby_no_expensive = 1 |
2713 | 2749 | < |
2714 | | -Whitespace errors can be highlighted by defining "ruby_space_errors": > |
| 2750 | +In this case the same color will be used for all control keywords. |
2715 | 2751 |
|
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. |
| 2752 | + *ruby_minlines* |
2722 | 2753 |
|
2723 | | -Folding can be enabled by defining "ruby_fold": > |
| 2754 | +If you do want this feature enabled, but notice highlighting errors while |
| 2755 | +scrolling backwards, which are fixed when redrawing with CTRL-L, try setting |
| 2756 | +the "ruby_minlines" variable to a value larger than 50: > |
2724 | 2757 |
|
2725 | | - :let ruby_fold = 1 |
| 2758 | + :let ruby_minlines = 100 |
2726 | 2759 | < |
2727 | | -This will set the 'foldmethod' option to "syntax" and allow folding of |
2728 | | -classes, modules, methods, code blocks, heredocs and comments. |
| 2760 | +Ideally, this value should be a number of lines large enough to embrace your |
| 2761 | +largest class or module. |
| 2762 | + |
| 2763 | + *ruby_spellcheck_strings* |
| 2764 | + Ruby: Spellchecking strings ~ |
2729 | 2765 |
|
2730 | | -Folding of multiline comments can be disabled by defining |
2731 | | -"ruby_no_comment_fold": > |
| 2766 | +Ruby syntax will perform spellchecking of strings if you define |
| 2767 | +"ruby_spellcheck_strings": > |
2732 | 2768 |
|
2733 | | - :let ruby_no_comment_fold = 1 |
| 2769 | + :let ruby_spellcheck_strings = 1 |
2734 | 2770 | < |
2735 | 2771 |
|
2736 | 2772 | SCHEME *scheme.vim* *ft-scheme-syntax* |
|
0 commit comments