junegunn / junegunn/vim-easy-align

Aligning nested objects

Open
#112 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
4.2k
Forks
122
PR merge metrics
No merged PRs in 30d

Description

Hi,

I've been looking around the docs but could not find a way to do this. Say I have a nested javascript object, such as this:

```
var collection = {
title: "Star Wars",
author: "George Lucas & others",
episodes: {
"IV": "A New Hope",
"V": "The Empire Strikes Back",
"VI": "Revenge of the Sith"
}
}
```

What is the fastest way to align the colons taking into account the nesting, so it becomes like this?

```
var collection = {
title : "Star Wars",
author : "George Lucas & others",
episodes: {
"IV": "A New Hope",
"V" : "The Empire Strikes Back",
"VI": "Revenge of the Sith"
}
}
```
The only way I've found so far is manually selecting every sub-object, but that's a bit painful with lots of nesting / lots of individual objects.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.