maksimr/vim-jsbeautify — pull request #35 by ibash (2013-12-19 22:24:46+00:00)
Title: Add range beautify functions

The use case is that I typically don't want to beautify a whole file, but just a little bit of code I've selected.
Range*Beautify allows you to do a visual selection and beautify just that.
Also using delete / append s.t. it doesn't overwrite lines below if the beautified code takes more lines.

Start:
```
var blah = 'hi';
var b = {does: 'it', work: 'huh?'};

var c = {does: 'it', work: 'huh?'};

var d = {does: 'it', work: 'huh?'};
```

Visual select lines `var b...` and `var c...` and then beautify with range beautifier.

End:
```
var blah = 'hi';
var b = {
does: 'it',
work: 'huh?'
};

var c = {
does: 'it',
work: 'huh?'
};

var d = {does: 'it', work: 'huh?'};
```