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

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

207 active golfers, 1301 entries

Solutions by @a0di:
17
#32 - Andrew / @a0di

10/31/2024 at 10:48AM

18
#>40 - Andrew / @a0di

10/31/2024 at 10:45AM

19
#>58 - Andrew / @a0di

10/31/2024 at 10:44AM

20
#>65 - Andrew / @a0di

10/31/2024 at 10:27AM

21
#>74 - Andrew / @a0di

10/31/2024 at 09:05AM

21
#>74 - Andrew / @a0di

10/31/2024 at 09:08AM

23
#>87 - Andrew / @a0di

10/31/2024 at 09:03AM

26
#>115 - Andrew / @a0di

10/31/2024 at 08:35AM

28
#>127 - Andrew / @a0di

10/31/2024 at 08:33AM

29
#>132 - Andrew / @a0di

10/31/2024 at 08:31AM

31
#>139 - Andrew / @a0di

10/31/2024 at 08:14AM

36
#>162 - Andrew / @a0di

10/30/2024 at 08:34PM