Skip to content

Commit 84afb55

Browse files
committed
Documentation
1 parent 355dbb0 commit 84afb55

1 file changed

Lines changed: 36 additions & 11 deletions

File tree

doc/vim-ruby.txt

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
1. Ruby motions |ruby-motion|
44
2. Ruby text objects |ruby-text-objects|
55
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|
78

89
==============================================================================
910
1. Ruby motions *ruby-motion*
@@ -113,27 +114,51 @@ Access modifier style "outdent":
113114
<
114115

115116
==============================================================================
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*
118119

119120
Different block indentation styles can be used by setting: >
120121
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'
123124
<
124125
By default, the "expression" block indent style is used.
125126

126127
Block indent style "expression":
127128
>
128-
first
129-
.second do |x|
130-
something
131-
end
129+
first
130+
.second do |x|
131+
something
132+
end
132133
<
133134
Block indent style "do":
134135
>
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
137162
something
138163
end
139164
<

0 commit comments

Comments
 (0)