Usability improvements

- Preserve indentation when a line starts with a delimiter
  - Useful for aligning multi-line method chains
- Renamed `margin_{left,right}` to `{left,right}_margin
  - Makes it easier to type in (`l`, `r`)
  - `margin_{left,right}` is still supported
- Margins can be specified as the number of spaces, or as an arbitrary string
This commit is contained in:
Junegunn Choi
2013-08-05 23:41:31 +09:00
parent 20124bc622
commit 2486b9c6df
9 changed files with 223 additions and 49 deletions

View File

@@ -141,6 +141,31 @@ mysql:
```
Formatting multi-line method chaining
-------------------------------------
Try `<Enter>.` or `<Enter>*.` on the following lines.
```ruby
my_object
.method1().chain()
.second_method().call()
.third().call()
.method_4().execute()
```
Notice that the indentation is adjusted to match the shortest one among those of
the lines starting with the delimiter.
```ruby
my_object
.method1() .chain()
.second_method().call()
.third() .call()
.method_4() .execute()
```
Partial alignment in block-visual mode / Negative field index
-------------------------------------------------------------