A Vim command for formatting objects

Viewed 104

Is there an easy shortcut (or plugin) in Vim that can help with formatting code like this:

var obj = {
    one: 1,
    two: 2,
    three: 3,
    four: 4
};

into this?

var obj = {
    one    : 1,
    two    : 2,
    three  : 3,
    four   : 4
};
2 Answers
Related