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

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

144 active golfers, 602 entries

Solutions by @alexmatthaios:
15
#34 - Alex / @alexmatthaios

07/19/2024 at 09:51PM

16
#>39 - Alex / @alexmatthaios

07/19/2024 at 09:44PM

17
#>44 - Alex / @alexmatthaios

07/19/2024 at 09:42PM

20
#>62 - Alex / @alexmatthaios

07/19/2024 at 08:37PM

21
#>76 - Alex / @alexmatthaios

07/19/2024 at 07:12PM

21
#>76 - Alex / @alexmatthaios

07/19/2024 at 07:40PM

21
#>76 - Alex / @alexmatthaios

07/19/2024 at 07:56PM

21
#>76 - Alex / @alexmatthaios

07/19/2024 at 07:58PM

21
#>76 - Alex / @alexmatthaios

07/19/2024 at 08:11PM

21
#>76 - Alex / @alexmatthaios

07/19/2024 at 08:35PM

22
#>89 - Alex / @alexmatthaios

07/19/2024 at 07:55PM

22
#>89 - Alex / @alexmatthaios

07/19/2024 at 08:00PM

24
#>98 - Alex / @alexmatthaios

07/19/2024 at 06:51PM

24
#>98 - Alex / @alexmatthaios

07/19/2024 at 08:01PM

26
#>108 - Alex / @alexmatthaios

07/19/2024 at 07:07PM