Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 9v0067255515000000000597

Nested JSON Flattener

Transform a deeply nested JSON structure into a flattened key-value format where each path is represented by dot notation

Start file
{
  "company": {
    "details": {
      "name": "TechCorp",
      "founded": 1995,
      "isPublic": true
    },
    "locations": {
      "headquarters": {
        "address": {
          "street": "123 Innovation Way",
          "unit": "4B",
          "city": "San Francisco",
          "state": "CA",
          "zip": "94105"
        },
        "coordinates": {
          "lat": 37.7749,
          "lng": -122.4194
        }
      },
      "branches": {
        "europe": {
          "primary": {
            "city": "London",
            "employees": 250,
            "opened": "2020-01-15"
          },
          "secondary": {
            "city": "Berlin",
            "employees": 120,
            "opened": "2021-03-01"
          }
        },
        "asia": {
          "primary": {
            "city": "Tokyo",
            "employees": 180,
            "opened": "2019-11-30"
          }
        }
      }
    },
    "metrics": {
      "financial": {
        "revenue": {
          "2021": 1500000,
          "2022": 2200000,
          "2023": 3100000
        },
        "expenses": {
          "2021": 1200000,
          "2022": 1800000,
          "2023": 2500000
        }
      },
      "performance": {
        "goals": {
          "q1": 85,
          "q2": 90,
          "q3": 88,
          "q4": 92
        }
      }
    }
  }
}
End file
company.details.name=TechCorp
company.details.founded=1995
company.details.isPublic=true
company.locations.headquarters.address.street=123 Innovation Way
company.locations.headquarters.address.unit=4B
company.locations.headquarters.address.city=San Francisco
company.locations.headquarters.address.state=CA
company.locations.headquarters.address.zip=94105
company.locations.headquarters.coordinates.lat=37.7749
company.locations.headquarters.coordinates.lng=-122.4194
company.locations.branches.europe.primary.city=London
company.locations.branches.europe.primary.employees=250
company.locations.branches.europe.primary.opened=2020-01-15
company.locations.branches.europe.secondary.city=Berlin
company.locations.branches.europe.secondary.employees=120
company.locations.branches.europe.secondary.opened=2021-03-01
company.locations.branches.asia.primary.city=Tokyo
company.locations.branches.asia.primary.employees=180
company.locations.branches.asia.primary.opened=2019-11-30
company.metrics.financial.revenue.2021=1500000
company.metrics.financial.revenue.2022=2200000
company.metrics.financial.revenue.2023=3100000
company.metrics.financial.expenses.2021=1200000
company.metrics.financial.expenses.2022=1800000
company.metrics.financial.expenses.2023=2500000
company.metrics.performance.goals.q1=85
company.metrics.performance.goals.q2=90
company.metrics.performance.goals.q3=88
company.metrics.performance.goals.q4=92

View Diff

1,67c1,29
< {
<   "company": {
<     "details": {
<       "name": "TechCorp",
<       "founded": 1995,
<       "isPublic": true
<     },
<     "locations": {
<       "headquarters": {
<         "address": {
<           "street": "123 Innovation Way",
<           "unit": "4B",
<           "city": "San Francisco",
<           "state": "CA",
<           "zip": "94105"
<         },
<         "coordinates": {
<           "lat": 37.7749,
<           "lng": -122.4194
<         }
<       },
<       "branches": {
<         "europe": {
<           "primary": {
<             "city": "London",
<             "employees": 250,
<             "opened": "2020-01-15"
<           },
<           "secondary": {
<             "city": "Berlin",
<             "employees": 120,
<             "opened": "2021-03-01"
<           }
<         },
<         "asia": {
<           "primary": {
<             "city": "Tokyo",
<             "employees": 180,
<             "opened": "2019-11-30"
<           }
<         }
<       }
<     },
<     "metrics": {
<       "financial": {
<         "revenue": {
<           "2021": 1500000,
<           "2022": 2200000,
<           "2023": 3100000
<         },
<         "expenses": {
<           "2021": 1200000,
<           "2022": 1800000,
<           "2023": 2500000
<         }
<       },
<       "performance": {
<         "goals": {
<           "q1": 85,
<           "q2": 90,
<           "q3": 88,
<           "q4": 92
<         }
<       }
<     }
<   }
< }
---
> company.details.name=TechCorp
> company.details.founded=1995
> company.details.isPublic=true
> company.locations.headquarters.address.street=123 Innovation Way
> company.locations.headquarters.address.unit=4B
> company.locations.headquarters.address.city=San Francisco
> company.locations.headquarters.address.state=CA
> company.locations.headquarters.address.zip=94105
> company.locations.headquarters.coordinates.lat=37.7749
> company.locations.headquarters.coordinates.lng=-122.4194
> company.locations.branches.europe.primary.city=London
> company.locations.branches.europe.primary.employees=250
> company.locations.branches.europe.primary.opened=2020-01-15
> company.locations.branches.europe.secondary.city=Berlin
> company.locations.branches.europe.secondary.employees=120
> company.locations.branches.europe.secondary.opened=2021-03-01
> company.locations.branches.asia.primary.city=Tokyo
> company.locations.branches.asia.primary.employees=180
> company.locations.branches.asia.primary.opened=2019-11-30
> company.metrics.financial.revenue.2021=1500000
> company.metrics.financial.revenue.2022=2200000
> company.metrics.financial.revenue.2023=3100000
> company.metrics.financial.expenses.2021=1200000
> company.metrics.financial.expenses.2022=1800000
> company.metrics.financial.expenses.2023=2500000
> company.metrics.performance.goals.q1=85
> company.metrics.performance.goals.q2=90
> company.metrics.performance.goals.q3=88
> company.metrics.performance.goals.q4=92

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 28 remaining solutions by signing in and submitting your own entry
#29 phaym / @phaym - Score: 337 - 10/11/25 @ 18:02
ddGddggqa%dd<C-O>f:C.<Esc>^"rYqqbj"rPJxx%q@b@bggdd@a@b@@@@j^@a@b@bj@a@b@@ggddjjjdd@a@b@@j@a@b@@jdd@a@b@@j@a@bggjjjdd@a@b@@@@@@@@j@a@b@@jdd@a@b@@j@a@bjdd@a@b@@@@j@aukkkk@a@b@@@@jdd@a@b@@@@@@14ggkdd@a@b@@@@j@a@b@@@@jdd@a@B@@@@jddjjjddjjjdd:%/<BS>s/\s*:<S-><BS>"?<BS>//g<CR>:%s/,/g<CR>:%s/:/=<Left><Left>\s<Right><Right>/<CR>21ggdd13ggdd19gg19gg10ggdd4ggdd14ggddjjj$x:%/<BS>s/:/=/<CR>j:5<BS>%s/g$/<CR>ZZ

0 comments


Created by: @pacuna

29 active golfers, 126 entries

Leaderboard (lowest score wins):
44
#1 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

11/10/2024 at 12:22AM

44
#2 - Peppa Pig / @PeppaPigSg

11/10/2024 at 04:04AM

44
#3 - Gavin / @GavinKoeng

12/09/2025 at 08:29AM

44
#4 - Konrad Guzek / @kguzek

12/25/2025 at 11:00PM

56
#5 - Christensen, Scott (S.C.) / @MCHRI120_ford

11/04/2024 at 03:29PM

56
#6 - dejam2007 / @dejam2007

01/01/2025 at 01:57PM

56
#7 - Leon Kacowicz / @leonkacowicz

05/09/2025 at 12:35PM

56
#8 - Daniel Fleischman / @danielf

05/09/2025 at 11:41PM

56
#9 - Tom11w / @Tom11Wh

05/12/2025 at 07:39AM

56
#10 - winter-loo / @winter-loo

05/27/2025 at 09:25AM

56
#11 - petr-kx / @petr-kx

08/09/2025 at 06:53PM

56
#12 - Vsevolod Rychkov / @MadPigeon

11/06/2025 at 11:18AM

56
#13 - Aly Thobani / @alythobani

11/23/2025 at 09:21PM

67
#14 - Saurav / @epicblueprints

11/09/2024 at 03:26PM

68
#15 - ehre9305 / @ehre9305

11/02/2024 at 12:47AM

69
#16 - Ming / @x51ming

04/20/2025 at 03:53PM

71
#17 - Oleksii Sanin / @AlexSanin

11/17/2024 at 11:26PM

72
#18 - M S Dheeraj Murthy / @Dheeraj-Murthy

11/11/2024 at 10:49AM

83
#19 - chujDK / @chujDK

03/03/2025 at 08:58AM

85
#20 - Sebastian Caicedo / @jsebdev

04/20/2025 at 10:07PM

99
#21 - cr100 / @rekicc

11/06/2024 at 11:11AM

99
#22 - rkorolovych / @rkorolovych

06/23/2025 at 10:01AM

111
#23 - Gibson Starkweather / @boaf

05/29/2025 at 12:27AM

141
#24 - MartnRamtin / @MartnRamtin

01/04/2025 at 05:50PM

144
#25 - Lily / @totallyuniquelily

11/21/2024 at 05:45AM

155
#26 - Herschel / @herschel-ma

01/06/2025 at 10:54AM

161
#27 - Heitor Dantas / @heitordnts

12/18/2024 at 02:09AM

277
#28 - Seagull2004 / @Seagull2004

12/11/2025 at 03:15PM

337
#29 - phaym / @phaym

10/11/2025 at 06:02PM