|
3 | 3 | 1. Ruby motions |ruby-motion| |
4 | 4 | 2. Ruby text objects |ruby-text-objects| |
5 | 5 | 3. Access modifier indentation |ruby-access-modifier-indentation| |
6 | | -4. Block style indentation |ruby-block-indentation| |
| 6 | +4. Block style indentation |ruby-block-style-indentation| |
| 7 | +5. Assignment style indentation |ruby-assignment-style-indentation| |
7 | 8 |
|
8 | 9 | ============================================================================== |
9 | 10 | 1. Ruby motions *ruby-motion* |
@@ -113,27 +114,51 @@ Access modifier style "outdent": |
113 | 114 | < |
114 | 115 |
|
115 | 116 | ============================================================================== |
116 | | -4. Block style indentation *ruby-block-style-indentation* |
117 | | - *g:ruby_indent_block_style* |
| 117 | +4. Block style indentation *ruby-block-style-indentation* |
| 118 | + *g:ruby_indent_block_style* |
118 | 119 |
|
119 | 120 | Different block indentation styles can be used by setting: > |
120 | 121 |
|
121 | | - :let g:ruby_indent_block_style = 'expression' |
122 | | - :let g:ruby_indent_block_style = 'do' |
| 122 | + :let g:ruby_indent_block_style = 'expression' |
| 123 | + :let g:ruby_indent_block_style = 'do' |
123 | 124 | < |
124 | 125 | By default, the "expression" block indent style is used. |
125 | 126 |
|
126 | 127 | Block indent style "expression": |
127 | 128 | > |
128 | | - first |
129 | | - .second do |x| |
130 | | - something |
131 | | - end |
| 129 | + first |
| 130 | + .second do |x| |
| 131 | + something |
| 132 | + end |
132 | 133 | < |
133 | 134 | Block indent style "do": |
134 | 135 | > |
135 | | - first |
136 | | - .second do |x| |
| 136 | + first |
| 137 | + .second do |x| |
| 138 | + something |
| 139 | + end |
| 140 | +< |
| 141 | + |
| 142 | +============================================================================== |
| 143 | +5. Assignment style indentation *ruby-assignment-style-indentation* |
| 144 | + *g:ruby_indent_assignment_style* |
| 145 | + |
| 146 | +Different styles of indenting assignment for multiline expressions: |
| 147 | +> |
| 148 | + :let g:ruby_indent_assignment_style = 'hanging' |
| 149 | + :let g:ruby_indent_assignment_style = 'variable' |
| 150 | +< |
| 151 | +By default, the "hanging" style is used. |
| 152 | + |
| 153 | +Assignment indent style "hanging": |
| 154 | +> |
| 155 | + x = if condition |
| 156 | + something |
| 157 | + end |
| 158 | +< |
| 159 | +Assignment indent style "variable": |
| 160 | +> |
| 161 | + x = if condition |
137 | 162 | something |
138 | 163 | end |
139 | 164 | < |
|
0 commit comments