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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 196 remaining solutions by signing in and submitting your own entry
#197 nockschii / @nockschii - Score: 670 - 08/20/24 @ 23:46
<Down><Down>lllllydy<Esc><Esc>kkl<C-A>Ap<BS><Esc>p<Esc>ppllklkjjkk<0xc3><0xb6><0xc3><0xb6><C-A>Ap<BS><Esc>pppp<Down><Down><Right><Right><Right><Right><Right>v<Right><Right>y<Up><Up><Right>p<Down><Down><Up><Down>dd<Up><Up>,i,<Left>l<BS><Esc>lljjlljhkvlllykkpuhpklkjjd<Esc>hhhxxxxxvllllyvlllldoo<BS>u<Esc>ukkllljkhpkjjhvhhhhyxxxxxxkkllllllllp<BS>xo<BS>hhh<BS><BS><BS>jj<BS><BS>h<BS>j<BS><Esc>jl<Esc>ljkkhhp<BS>xlljlkh <0xc3><0x84>x<Esc><Esc>i<0xc3><0x84><BS><BS>'2',jj<BS><BS><Esc>jjjhhhhhhhvhhhhylvllldkkkllllllllllpjjjjkhhhhhhhhhvlllpuvllly3vykkk<0xc3><0xb6>lllllllllllllpllllllllxlkkjjjjddjlk3vykkklkeeeeeeeeeeeepkkjjjjjjjkkddklkjj<0xc3><0xb6>jlk3vyddlkkkkkeeeeeeeeeeeeeeekeehxd<Esc>pppp<Esc>p<BS><BS><BS><BS>xxxxx<0xc3><0xa4>A<0xc3><0x84><BS><BS>A<BS>'9<BS>8<0xc3><0x84><BS><BS>',m<BS>'9<0xc3><0x84>'<BS><BS><BS>']h<BS>kk<BS><BS><Esc>kkjjjjjvj<Esc>klllll2vp<Esc>u2vyddkkkddddddddddkeeeA<Esc>p<BS>p<BS><Down>x<Down>xx<Esc>xx<Up>dddd<Up>eeeeeeeeeeeeeeeeeeeeeeeeeeeee,<Esc><Esc>i,<0xc3><0x84><0xc3><0x84><BS><BS><BS><BS> ''<Esc>aa<BS>B<BS><Esc>BBBBBB<0xc3><0xb6><0xc3><0xb6>lllli <Esc>llllli ll<BS><BS><Esc>llllli l<BS><Esc>llllli <Esc>llllli <Esc>wewewewei<Esc>  jhi e<BS><Esc>eeeeeei <Esc>eeeehhllhi <Esc>:wq<CR>

0 comments


Created by: @maharba6

197 active golfers, 1221 entries

Leaderboard (lowest score wins):
21
#61 - Namdrib / @Namdrib

07/21/2024 at 11:33AM

21
#62 - Michael / @thscuriousquest

07/21/2024 at 09:02PM

21
#63 - ShookerAndBeta / @Shooker2012

07/24/2024 at 02:05AM

21
#64 - Patrick / @TIisWack

08/02/2024 at 09:39PM

21
#65 - Alex Khakhlyuk / @khakhlyuk

08/21/2024 at 02:20PM

21
#66 - Prem Netsuwan / @grnnja

08/27/2024 at 04:27PM

21
#67 - Евгений Шевченко / @3530385

09/03/2024 at 03:52AM

21
#68 - Håkon Anders Strømsodd / @haakon8855

09/23/2024 at 09:59AM

22
#69 - ericlovesmath / @ericlovesmath

08/09/2024 at 07:59PM

22
#70 - TimMcGuire / @mcguire

08/16/2024 at 02:44PM

22
#71 - Joel Williams / @10WilliamsJoel

09/05/2024 at 10:56AM

23
#72 - HAYASHI-Masayuki / @HAYASHI-Masayuki

07/27/2024 at 10:21AM

23
#73 - amberg12 / @amberg12

08/02/2024 at 07:40PM

23
#74 - whisperbeam / @whisperbeam

08/09/2024 at 09:31PM

23
#75 - Kyle Liu / @kyleliu-code

08/10/2024 at 08:36AM

23
#76 - Ariel Buchwald-Kearney / @arielbk

08/18/2024 at 02:59PM

23
#77 - Henry Sloan / @HenryKSloan

08/29/2024 at 06:23PM

23
#78 - reatter / @reatter

09/17/2024 at 12:52PM

23
#79 - Vincent DL / @NotVince

09/29/2024 at 03:43PM

23
#80 - whitedogsuk / @whitedogsuk

10/06/2024 at 11:00PM

24
#81 - Someone / @inventfossil

07/22/2024 at 06:32PM

24
#82 - Marcos Almeida / @maurelio1234

07/27/2024 at 04:35PM

24
#83 - Blake Tereau / @BlakeTereau

08/01/2024 at 05:53AM

24
#84 - Len / @inorichi

08/05/2024 at 10:49PM

24
#85 - hk416hasu / @hk416hasu

08/06/2024 at 10:08AM

24
#86 - Jelani Felix / @Jelanife

08/08/2024 at 02:35PM

24
#87 - mgn1440 / @mgn1440

08/14/2024 at 02:27PM

24
#88 - Guilherme Natan / @Guilherme-Natan

08/21/2024 at 08:51PM

24
#89 - tncargil / @tncargil

08/25/2024 at 03:16AM

24
#90 - reirob / @reirob

08/31/2024 at 06:38AM