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

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

171 active golfers, 1002 entries

Solutions by @BlockLune:
30
#104 - BlockLune / @BlockLune

08/10/2024 at 03:40AM

34
#>122 - BlockLune / @BlockLune

08/10/2024 at 03:40AM

36
#>131 - BlockLune / @BlockLune

08/10/2024 at 03:36AM

36
#>131 - BlockLune / @BlockLune

08/10/2024 at 03:39AM

45
#>148 - BlockLune / @BlockLune

08/10/2024 at 03:32AM

63
#>156 - BlockLune / @BlockLune

08/10/2024 at 03:25AM

65
#>156 - BlockLune / @BlockLune

08/10/2024 at 03:25AM

73
#>157 - BlockLune / @BlockLune

08/10/2024 at 03:23AM

76
#>157 - BlockLune / @BlockLune

08/10/2024 at 03:22AM