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

205 active golfers, 1298 entries

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

09/24/2024 at 05:10AM

15
#>13 - MatFriend / @MatFriend

09/24/2024 at 05:08AM

16
#>29 - MatFriend / @MatFriend

09/24/2024 at 05:07AM

17
#>30 - MatFriend / @MatFriend

09/24/2024 at 05:01AM

17
#>30 - MatFriend / @MatFriend

09/24/2024 at 05:03AM

18
#>39 - MatFriend / @MatFriend

09/24/2024 at 04:59AM

19
#>57 - MatFriend / @MatFriend

09/24/2024 at 04:58AM

20
#>64 - MatFriend / @MatFriend

09/24/2024 at 04:57AM

21
#>74 - MatFriend / @MatFriend

09/24/2024 at 04:54AM

22
#>77 - MatFriend / @MatFriend

09/24/2024 at 04:52AM

23
#>85 - MatFriend / @MatFriend

09/24/2024 at 04:51AM

24
#>97 - MatFriend / @MatFriend

09/24/2024 at 04:49AM

27
#>119 - MatFriend / @MatFriend

09/24/2024 at 04:41AM

37
#>165 - MatFriend / @MatFriend

09/24/2024 at 04:10AM

43
#>178 - MatFriend / @MatFriend

09/24/2024 at 04:05AM

44
#>180 - MatFriend / @MatFriend

09/24/2024 at 03:59AM