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 @n-mhn:

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

197 active golfers, 1221 entries

Solutions by @n-mhn:
16
#20 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:24AM

19
#>49 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:19AM

20
#>55 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:18AM

21
#>64 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:17AM

22
#>69 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:16AM

23
#>75 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:15AM

24
#>87 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:51AM

25
#>93 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:47AM

30
#>124 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:43AM

31
#>127 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:42AM

32
#>133 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:35AM

42
#>167 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:25AM

44
#>171 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:23AM

51
#>175 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:19AM

61
#>180 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:16AM

80
#>181 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:12AM

150
#>190 - Yusuke Sakai / @n-mhn

08/16/2024 at 02:46AM