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 9v006694339a0000000002e2

Rearrange array to one line

Rearrange the array content on only one line, and remove trailing commas

Start file
const data = [
  {
    goal: 400,
  },
  {
    goal: 300,
  },
  {
    goal: 200,
  },
  {
    goal: 300,
  },
  {
    goal: 200,
  },
  {
    goal: 278,
  },
  {
    goal: 189,
  },
  {
    goal: 239,
  },
  {
    goal: 300,
  },
  {
    goal: 200,
  },
  {
    goal: 278,
  },
  {
    goal: 189,
  },
  {
    goal: 349,
  },
]
End file
const data = [
  { goal: 400 }, { goal: 300 }, { goal: 200 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 239 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 349 }
]

View Diff

2,40c2
<   {
<     goal: 400,
<   },
<   {
<     goal: 300,
<   },
<   {
<     goal: 200,
<   },
<   {
<     goal: 300,
<   },
<   {
<     goal: 200,
<   },
<   {
<     goal: 278,
<   },
<   {
<     goal: 189,
<   },
<   {
<     goal: 239,
<   },
<   {
<     goal: 300,
<   },
<   {
<     goal: 200,
<   },
<   {
<     goal: 278,
<   },
<   {
<     goal: 189,
<   },
<   {
<     goal: 349,
<   },
---
>   { goal: 400 }, { goal: 300 }, { goal: 200 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 239 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 349 }

Solutions by @_AlexLewin:

Unlock 7 remaining solutions by signing in and submitting your own entry
Created by: @alexandregv

144 active golfers, 602 entries

Solutions by @_AlexLewin:
13
#8 - Alex Lewin / @_AlexLewin

07/23/2024 at 10:01PM

13
#>8 - Alex Lewin / @_AlexLewin

07/23/2024 at 10:01PM

15
#>34 - Alex Lewin / @_AlexLewin

07/23/2024 at 10:00PM

16
#>39 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:59PM

20
#>63 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:59PM

21
#>77 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:58PM

83
#>141 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:57PM