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 @brett-collins_cbhq:

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

144 active golfers, 602 entries

Solutions by @brett-collins_cbhq:
13
#18 - Brett Collins / @brett-collins_cbhq

10/02/2024 at 05:42PM

14
#>29 - Brett Collins / @brett-collins_cbhq

10/02/2024 at 05:40PM

15
#>37 - Brett Collins / @brett-collins_cbhq

10/02/2024 at 05:36PM

16
#>43 - Brett Collins / @brett-collins_cbhq

10/02/2024 at 05:35PM

17
#>46 - Brett Collins / @brett-collins_cbhq

10/02/2024 at 05:34PM

18
#>49 - Brett Collins / @brett-collins_cbhq

10/02/2024 at 05:29PM

19
#>58 - Brett Collins / @brett-collins_cbhq

10/02/2024 at 05:27PM

22
#>94 - Brett Collins / @brett-collins_cbhq

10/01/2024 at 10:24PM

27
#>117 - Brett Collins / @brett-collins_cbhq

08/19/2024 at 05:43PM