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

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

144 active golfers, 602 entries

Solutions by @petterhs:
15
#35 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 12:29PM

16
#>39 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:50AM

17
#>45 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:48AM

19
#>52 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:44AM

20
#>65 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:40AM

21
#>82 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:33AM

26
#>111 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:30AM

27
#>116 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:27AM

31
#>126 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:25AM

42
#>132 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 10:20AM

99
#>141 - Petter Hoem Sletsjøe / @petterhs

08/06/2024 at 09:39AM