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

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

272 active golfers, 1649 entries

Solutions by @JGEsteves89:
17
#45 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:58PM

18
#>55 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:58PM

19
#>72 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:57PM

20
#>80 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:56PM

21
#>88 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:54PM

22
#>94 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:53PM

23
#>105 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:52PM

24
#>121 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:50PM

26
#>143 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:20PM

26
#>143 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:46PM

30
#>169 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:15PM

30
#>169 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:18PM

32
#>184 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:09PM

43
#>231 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 09:02PM

67
#>251 - Eng. José Esteves / @JGEsteves89

02/15/2025 at 08:58PM