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

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

186 active golfers, 1094 entries

Solutions by @llistnr:
19
#35 - Seungho Lee / @llistnr

07/23/2024 at 05:48AM

20
#>48 - Seungho Lee / @llistnr

07/23/2024 at 05:46AM

21
#>56 - Seungho Lee / @llistnr

07/23/2024 at 05:47AM

24
#>75 - Seungho Lee / @llistnr

07/23/2024 at 05:38AM

24
#>75 - Seungho Lee / @llistnr

07/23/2024 at 05:43AM

28
#>104 - Seungho Lee / @llistnr

07/23/2024 at 05:58AM