|
1 | | -RUBY *ruby.vim* *ft-ruby-syntax* |
| 1 | +RUBY *ruby.vim* *ft-ruby-syntax* |
2 | 2 |
|
3 | 3 | There are a number of options to the Ruby syntax highlighting. |
4 | 4 |
|
5 | | -By default, the "end" keyword is colorized according to the opening statement |
6 | | -of the block it closes. While useful, this feature can be expensive; if you |
7 | | -experience slow redrawing (or you are on a terminal with poor color support) |
8 | | -you may want to turn it off by defining the "ruby_no_expensive" variable: > |
| 5 | +1. Ruby operators |ruby_operators| |
| 6 | +2. Whitespace errors |ruby_space_errors| |
| 7 | +3. Folds |ruby_fold| |
| 8 | +4. Reducing expensive operations |ruby_no_expensive| |ruby_minlines| |
9 | 9 |
|
10 | | - :let ruby_no_expensive = 1 |
11 | | -< |
12 | | -In this case the same color will be used for all control keywords. |
13 | 10 |
|
14 | | -If you do want this feature enabled, but notice highlighting errors while |
15 | | -scrolling backwards, which are fixed when redrawing with CTRL-L, try setting |
16 | | -the "ruby_minlines" variable to a value larger than 50: > |
| 11 | +============================================================================== |
| 12 | +1. Ruby operators *ruby_operators* |
17 | 13 |
|
18 | | - :let ruby_minlines = 100 |
19 | | -< |
20 | | -Ideally, this value should be a number of lines large enough to embrace your |
21 | | -largest class or module. |
| 14 | +Ruby operators can be highlighted. |
22 | 15 |
|
23 | | -Ruby operators can be highlighted. This is enabled by defining |
24 | | -"ruby_operators": > |
| 16 | +This is enabled by defining "ruby_operators": > |
25 | 17 |
|
26 | 18 | :let ruby_operators = 1 |
27 | 19 | < |
| 20 | + |
| 21 | +============================================================================== |
| 22 | +2. Whitespace errors *ruby_space_errors* |
| 23 | + |
28 | 24 | Whitespace errors can be highlighted by defining "ruby_space_errors": > |
29 | 25 |
|
30 | 26 | :let ruby_space_errors = 1 |
31 | 27 | < |
| 28 | + |
32 | 29 | This will highlight trailing whitespace and tabs preceded by a space character |
33 | 30 | as errors. This can be refined by defining "ruby_no_trail_space_error" and |
34 | 31 | "ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after |
35 | 32 | spaces respectively. |
36 | 33 |
|
| 34 | +============================================================================== |
| 35 | +3. Folds *ruby_fold* |
| 36 | + |
| 37 | +Folds can be enabled by defining "ruby_fold": > |
| 38 | +
|
37 | 39 | :let ruby_fold = 1 |
38 | 40 | < |
| 41 | + |
39 | 42 | This will set the value |foldmethod| to "syntax" locally to the current buffer |
40 | 43 | or window, which will enable syntax-based folding when editing Ruby filetypes. |
41 | | -> |
| 44 | + |
| 45 | +============================================================================== |
| 46 | +4. Reducing expensive operations *ruby_no_expensive* |
| 47 | + |
| 48 | +By default, the "end" keyword is colorized according to the opening statement |
| 49 | +of the block it closes. While useful, this feature can be expensive; if you |
| 50 | +experience slow redrawing (or you are on a terminal with poor color support) |
| 51 | +you may want to turn it off by defining the "ruby_no_expensive" variable: > |
| 52 | +
|
| 53 | + :let ruby_no_expensive = 1 |
| 54 | +< |
| 55 | +In this case the same color will be used for all control keywords. |
| 56 | + |
| 57 | + *ruby-minlines* |
| 58 | +If you do want this feature enabled, but notice highlighting errors while |
| 59 | +scrolling backwards, which are fixed when redrawing with CTRL-L, try setting |
| 60 | +the "ruby_minlines" variable to a value larger than 50: > |
| 61 | +
|
| 62 | + :let ruby_minlines = 100 |
| 63 | +< |
| 64 | +Ideally, this value should be a number of lines large enough to embrace your |
| 65 | +largest class or module. |
42 | 66 |
|
43 | 67 | vim:tw=78:sw=4:ts=8:ft=help:norl: |
0 commit comments