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

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

272 active golfers, 1649 entries

Solutions by @_AlexLewin:
14
#14 - Alex Lewin / @_AlexLewin

04/23/2025 at 11:55PM

14
#>14 - Alex Lewin / @_AlexLewin

04/23/2025 at 11:57PM

15
#>23 - Alex Lewin / @_AlexLewin

04/23/2025 at 11:55PM

16
#>26 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:49PM

16
#>39 - Alex Lewin / @_AlexLewin

08/29/2024 at 09:35PM

16
#>39 - Alex Lewin / @_AlexLewin

08/29/2024 at 09:37PM

19
#>59 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:48PM

21
#>82 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:48PM

24
#>109 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:47PM

28
#>153 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:46PM

30
#>165 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:44PM

32
#>185 - Alex Lewin / @_AlexLewin

04/23/2025 at 11:54PM

38
#>213 - Alex Lewin / @_AlexLewin

07/23/2024 at 09:43PM