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

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

144 active golfers, 602 entries

Solutions by @inventfossil:
14
#24 - Someone / @inventfossil

08/17/2024 at 07:14PM

15
#>35 - Someone / @inventfossil

08/17/2024 at 07:09PM

16
#>40 - Someone / @inventfossil

08/17/2024 at 07:08PM

17
#>46 - Someone / @inventfossil

08/17/2024 at 07:07PM

19
#>54 - Someone / @inventfossil

08/17/2024 at 06:52PM

20
#>68 - Someone / @inventfossil

08/13/2024 at 06:32PM

20
#>69 - Someone / @inventfossil

08/17/2024 at 06:35PM

21
#>82 - Someone / @inventfossil

08/13/2024 at 06:30PM

21
#>83 - Someone / @inventfossil

08/17/2024 at 06:33PM

21
#>83 - Someone / @inventfossil

08/17/2024 at 06:45PM

26
#>112 - Someone / @inventfossil

08/13/2024 at 06:10PM

29
#>123 - Someone / @inventfossil

08/13/2024 at 04:05PM

31
#>126 - Someone / @inventfossil

08/13/2024 at 06:06PM