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

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

234 active golfers, 1430 entries

Solutions by @yexia0:
14
#12 - yexia0 / @yexia0

01/04/2025 at 09:10AM

15
#>19 - yexia0 / @yexia0

01/04/2025 at 09:08AM

16
#>32 - yexia0 / @yexia0

01/04/2025 at 09:07AM

17
#>37 - yexia0 / @yexia0

01/04/2025 at 09:04AM

18
#>46 - yexia0 / @yexia0

01/04/2025 at 09:03AM

18
#>46 - yexia0 / @yexia0

01/04/2025 at 09:05AM

19
#>63 - yexia0 / @yexia0

01/04/2025 at 09:02AM

20
#>71 - yexia0 / @yexia0

01/04/2025 at 09:01AM

21
#>79 - yexia0 / @yexia0

01/04/2025 at 09:01AM

22
#>83 - yexia0 / @yexia0

01/04/2025 at 09:00AM

23
#>92 - yexia0 / @yexia0

01/04/2025 at 08:58AM

24
#>105 - yexia0 / @yexia0

01/04/2025 at 08:57AM

27
#>130 - yexia0 / @yexia0

01/04/2025 at 08:55AM

32
#>159 - yexia0 / @yexia0

01/04/2025 at 08:53AM

36
#>176 - yexia0 / @yexia0

01/04/2025 at 08:49AM

51
#>204 - yexia0 / @yexia0

01/04/2025 at 08:40AM