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 @mtklar:

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

146 active golfers, 606 entries

Solutions by @mtklar:
13
#20 - mtklar / @mtklar

10/25/2024 at 07:37AM

14
#>30 - mtklar / @mtklar

10/25/2024 at 07:36AM

15
#>38 - mtklar / @mtklar

10/25/2024 at 07:29AM

15
#>38 - mtklar / @mtklar

10/25/2024 at 07:32AM

16
#>44 - mtklar / @mtklar

10/25/2024 at 07:29AM

17
#>46 - mtklar / @mtklar

10/25/2024 at 07:28AM

18
#>49 - mtklar / @mtklar

10/25/2024 at 07:27AM

19
#>59 - mtklar / @mtklar

10/25/2024 at 07:26AM

20
#>73 - mtklar / @mtklar

10/25/2024 at 07:24AM

21
#>89 - mtklar / @mtklar

10/25/2024 at 07:22AM

22
#>96 - mtklar / @mtklar

10/25/2024 at 07:22AM

23
#>99 - mtklar / @mtklar

10/25/2024 at 07:16AM

27
#>123 - mtklar / @mtklar

10/25/2024 at 07:13AM

47
#>134 - mtklar / @mtklar

10/25/2024 at 07:09AM