@@ -5,7 +5,8 @@ There are a number of options to the Ruby syntax highlighting. |
5 | 5 | 1. Ruby operators |ruby_operators| |
6 | 6 | 2. Whitespace errors |ruby_space_errors| |
7 | 7 | 3. Folds |ruby_fold| |
8 | | -4. Reducing expensive operations |ruby_no_expensive| |ruby_minlines| |
| 8 | +4. Foldable groups |ruby_foldable_groups| |
| 9 | +5. Reducing expensive operations |ruby_no_expensive| |ruby_minlines| |
9 | 10 |
|
10 | 11 |
|
11 | 12 | 1. Ruby operators *ruby_operators* |
@@ -39,7 +40,40 @@ Folds can be enabled by defining "ruby_fold": > |
39 | 40 | This will set the value |foldmethod| to "syntax" locally to the current buffer |
40 | 41 | or window, which will enable syntax-based folding when editing Ruby filetypes. |
41 | 42 |
|
42 | | -4. Reducing expensive operations *ruby_no_expensive* |
| 43 | +4. Foldable groups *ruby_foldable_groups* |
| 44 | + |
| 45 | +Default folding is rather detailed, i.e., small syntax units like "if", "do", |
| 46 | +"%w[]" may create corresponding fold levels. |
| 47 | + |
| 48 | +You can set "ruby_foldable_groups" to restrict which groups are foldable: > |
| 49 | +
|
| 50 | + :let ruby_foldable_groups = 'if case %' |
| 51 | +< |
| 52 | +value is space-separated keywords, known keywords were: |
| 53 | + |
| 54 | + keyword meaning ~ |
| 55 | + -------- ------------------------------------- ~ |
| 56 | + ALL Most block syntax (default) |
| 57 | + NONE Nothing |
| 58 | + if "if" or "unless" block |
| 59 | + def "def" block |
| 60 | + class "class" block |
| 61 | + module "module" block |
| 62 | + do "do" block |
| 63 | + begin "begin" block |
| 64 | + case "case" block |
| 65 | + for "for", "while", "until" loops |
| 66 | + { Curly bracket block or hash literal |
| 67 | + [ Array literal |
| 68 | + % Literal with "%" notation, e.g.: %w(STRING), %!STRING! |
| 69 | + / Regexp |
| 70 | + string String and shell command output (surrounded by ', ", `) |
| 71 | + : Symbol |
| 72 | + # Multiline comment |
| 73 | + << Here documents |
| 74 | + __END__ Source code after "__END__" directive |
| 75 | + |
| 76 | +5. Reducing expensive operations *ruby_no_expensive* |
43 | 77 |
|
44 | 78 | By default, the "end" keyword is colorized according to the opening statement |
45 | 79 | of the block it closes. While useful, this feature can be expensive; if you |
|