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

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

248 active golfers, 1499 entries

Solutions by @MatFriend:
14
#6 - MatFriend / @MatFriend

09/24/2024 at 05:10AM

15
#>17 - MatFriend / @MatFriend

09/24/2024 at 05:08AM

16
#>34 - MatFriend / @MatFriend

09/24/2024 at 05:07AM

17
#>36 - MatFriend / @MatFriend

09/24/2024 at 05:01AM

17
#>36 - MatFriend / @MatFriend

09/24/2024 at 05:03AM

18
#>47 - MatFriend / @MatFriend

09/24/2024 at 04:59AM

19
#>65 - MatFriend / @MatFriend

09/24/2024 at 04:58AM

20
#>72 - MatFriend / @MatFriend

09/24/2024 at 04:57AM

21
#>82 - MatFriend / @MatFriend

09/24/2024 at 04:54AM

22
#>87 - MatFriend / @MatFriend

09/24/2024 at 04:52AM

23
#>95 - MatFriend / @MatFriend

09/24/2024 at 04:51AM

24
#>110 - MatFriend / @MatFriend

09/24/2024 at 04:49AM

27
#>139 - MatFriend / @MatFriend

09/24/2024 at 04:41AM

37
#>192 - MatFriend / @MatFriend

09/24/2024 at 04:10AM

43
#>211 - MatFriend / @MatFriend

09/24/2024 at 04:05AM

44
#>215 - MatFriend / @MatFriend

09/24/2024 at 03:59AM