Skip to main content
Add basic example as text.
Source Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274

When I start a ruby block in the middle of a line, the next line is indented deeper than I'd like. It's indented from the start of the block, not the start of the line.

That explanation was terrible, so here's a picture with a contrived example.Example:

Indentation

some_variable_name = begin
                       42
                     end

I would like line 42 to be indented one level deeper than 31. 5 3 should match 31. Same

Some more examples in this screenshot. Same logic applies to the case statement below.

When I start a ruby block in the middle of a line, the next line is indented deeper than I'd like. It's indented from the start of the block, not the start of the line.

That explanation was terrible, so here's a picture with a contrived example.

Indentation

I would like line 4 to be indented one level deeper than 3. 5 should match 3. Same logic applies to the case statement below

When I start a ruby block in the middle of a line, the next line is indented deeper than I'd like. It's indented from the start of the block, not the start of the line.

Example:

some_variable_name = begin
                       42
                     end

I would like line 2 to be indented one level deeper than 1. 3 should match 1.

Some more examples in this screenshot. Same logic applies to the case statement below.

Source Link
valadil
  • 143
  • 4

How do I control how vim indents ruby blocks?

When I start a ruby block in the middle of a line, the next line is indented deeper than I'd like. It's indented from the start of the block, not the start of the line.

That explanation was terrible, so here's a picture with a contrived example.

Indentation

I would like line 4 to be indented one level deeper than 3. 5 should match 3. Same logic applies to the case statement below