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

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

145 active golfers, 604 entries

Solutions by @countime:
13
#21 - countime / @countime

12/02/2024 at 07:13AM

14
#>30 - countime / @countime

12/02/2024 at 07:11AM

15
#>38 - countime / @countime

12/02/2024 at 07:10AM

16
#>44 - countime / @countime

12/02/2024 at 07:05AM

17
#>47 - countime / @countime

12/02/2024 at 07:04AM

18
#>49 - countime / @countime

12/02/2024 at 07:01AM

18
#>49 - countime / @countime

12/02/2024 at 07:02AM

19
#>59 - countime / @countime

12/02/2024 at 06:59AM

20
#>75 - countime / @countime

12/02/2024 at 06:56AM

21
#>89 - countime / @countime

12/02/2024 at 06:52AM

21
#>89 - countime / @countime

12/02/2024 at 06:55AM

23
#>99 - countime / @countime

12/02/2024 at 06:51AM