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 9v00669b3ff1000000000303

Rearrange array to single level

The goal is to flatten the array into a single list and remove any empty elements.

Start file
[
    []  ,
    [''],
    ['0', '1', '2'],
    ['3', '4', '5'],
    ['6', '7'],
    ['8', '9'],
    ['']
]
End file
['', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '']

View Diff

1,9c1
< [
<     []  ,
<     [''],
<     ['0', '1', '2'],
<     ['3', '4', '5'],
<     ['6', '7'],
<     ['8', '9'],
<     ['']
< ]
---
> ['', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '']

Solutions by @winter-loo:

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

254 active golfers, 1528 entries

Solutions by @winter-loo:
15
#22 - winter-loo / @winter-loo

06/22/2025 at 02:25PM

16
#>36 - winter-loo / @winter-loo

06/22/2025 at 02:23PM

17
#>42 - winter-loo / @winter-loo

06/22/2025 at 02:21PM

18
#>50 - winter-loo / @winter-loo

06/22/2025 at 02:19PM

19
#>67 - winter-loo / @winter-loo

06/22/2025 at 02:17PM

20
#>75 - winter-loo / @winter-loo

06/22/2025 at 02:15PM

20
#>75 - winter-loo / @winter-loo

06/22/2025 at 02:16PM

21
#>85 - winter-loo / @winter-loo

06/22/2025 at 02:14PM

22
#>89 - winter-loo / @winter-loo

06/22/2025 at 02:13PM

23
#>101 - winter-loo / @winter-loo

06/22/2025 at 02:10PM

31
#>165 - winter-loo / @winter-loo

06/22/2025 at 02:06PM