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 5a33022f2de3f1021300000d

Array propagate

Complete the array with the keys as part of the value

Start file
$arr = [
    'one_option' => '',
    'other' => '',
    'created_at' => '',
    'updated_at' => ''
]
End file
$arr = [
    'one_option' => $row['one_option'],
    'other' => $row['other'],
    'created_at' => $row['created_at'],
    'updated_at' => $row['updated_at']
]

View Diff

2,6c2,6
<     'one_option' => '',
<     'other' => '',
<     'created_at' => '',
<     'updated_at' => ''
< ]
\ No newline at end of file
---
>     'one_option' => $row['one_option'],
>     'other' => $row['other'],
>     'created_at' => $row['created_at'],
>     'updated_at' => $row['updated_at']
> ]

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 50 remaining solutions by signing in and submitting your own entry
#51 ikigai / ikigai27357012 - Score: 30 - 06/18/18 @ 12:03
jqq2wyw2Wi$row[<Esc>lpla]<Esc>0jq3@qZZ

0 comments


#52 Zyurs / The_Zyurs - Score: 31 - 12/15/17 @ 14:03
/'<CR>qalywnni$row[<Esc>lp<Esc>la]<Esc>nq3@aZZ

0 comments


#53 DQMSL対戦募集ツイートbot / foronlinegamer - Score: 32 - 03/20/18 @ 07:17
qa/'<CR>lyiwnnpla]<Esc>NNi$row[<Esc>$q3@aZZ

0 comments


#54 Ahmed Hasan / microbialwalrus - Score: 33 - 12/25/17 @ 18:18
jf'qdlvwhy2f'i$row[<Esc>lpla]<Esc>Wq3@dZZ

0 comments


#55 Wolly Woodpecker / WollyWoodpecker - Score: 37 - 01/01/18 @ 16:00
jqwf'vf'y$i]<Esc>bi$row[<C-R>0<Del><Del><Esc>j0q3@w<Up>$r]ZZ

0 comments


#56 eric / ericandrewlewis - Score: 40 - 12/15/17 @ 13:41
jqayi'f>lli$row['<C-R>0']<Esc>lxxj0q@a@@@@:w<CR>:q<CR>

0 comments


#57 Mathieu Larouche / matdube - Score: 40 - 12/15/17 @ 20:50
:%s/\('\w\+'\) => ''/\1 => $row[\1]/g<CR>ZZ

0 comments


#58 Miki Tebeka / tebeka - Score: 41 - 12/15/17 @ 04:59
:%s/'\(.*\)' => ''/'\1' => $row['\1']/<CR>ZZ

0 comments


#59 Mikael Axelsson / Mikael_Axelsson - Score: 41 - 12/15/17 @ 06:48
:%s/'\(.*\)' => ''/'\1' => $row['\1']/<CR>ZZ

0 comments


#60 allinonemovie / allinonemovie - Score: 44 - 12/17/17 @ 17:28
jqqf'vf'yf';i$row[<Esc>lvlpa]<Esc>q:3,5norm! @q<CR>:wq<CR>

0 comments


#61 Guillaume Seren / guillaumeseren - Score: 61 - 04/18/18 @ 07:49
:<50-53>%s/\s\{4\}'\(.\+\)' => ''/    '\1' => $row['\1']/<Esc>[201~g<CR>ZZ

0 comments


#62 BitLad / BitLad - Score: 74 - 01/31/18 @ 15:40
jEelli<0xc2><0xa3><BS>$row[<Esc>jb.jl,.jh.lau<C-N><Esc>la]<Esc>kh.<Esc>hhac<C-N><Esc>kblao<C-N><C-N><Esc>la]<Esc>kblaon<C-N><Esc>la[<BS>]<Esc>:wq<CR>

0 comments


#63 Dominic Z / thammaaa - Score: 90 - 12/21/17 @ 09:10
<Down>w/><CR>i<Right><Right>$row[<Right><C-N>o<BS><BS><BS><BS><BS>n<C-H>n<C-N><Right>]<Esc>ni<Right><Right>$<C-N><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>r<Tab><BS><C-N>[<Right><Right>]<Left><Left>ot<C-N><Down><Left><Left><Left>$row[<Right>cr<C-N><Right>]<Down><Left><Left>$row[<Right>up<C-N><Right>]<Esc>:x<CR>

0 comments


Created by: oscarmlage

63 active golfers, 162 entries

Leaderboard (lowest score wins):
23
#1 - Petro Тrouq / zulolosi

12/28/2017 at 06:02PM

23
#2 - ParasamGateZero / ParasamGateZero

01/17/2018 at 05:57AM

23
#3 - Oskar Fridell / rax0m

02/02/2018 at 03:47PM

23
#4 - Bart Reynolds / bartums

02/28/2018 at 02:54PM

23
#5 - GreenPinguin / GreenPinguin2

03/14/2018 at 12:50PM

23
#6 - Lisa Ugray / lisa_ugray

03/18/2018 at 01:03PM

23
#7 - c0llision / 0xc0llision

04/17/2018 at 08:52PM

23
#8 - Jay Knight / jayknight

05/03/2018 at 05:00PM

23
#9 - platypusDancing / platypusDancing

05/03/2018 at 07:11PM

23
#10 - Marcos Almeida / almeidamarcos_

05/05/2018 at 05:49PM

23
#11 - towc / MateiCopot

05/25/2018 at 07:04PM

24
#12 - Smylers / Smylers2

12/15/2017 at 12:59PM

24
#13 - John Braxler / braxler

12/15/2017 at 02:17PM

24
#14 - Jon Krause / jkrause314

12/15/2017 at 03:34PM

24
#15 - Sage san / sagesancast

12/17/2017 at 08:15PM

24
#16 - Saki Gw / Sakigw

12/19/2017 at 02:00PM

24
#17 - deepak / utopianmonk

12/22/2017 at 10:01AM

24
#18 - BarbaJol / drpproteus

12/30/2017 at 05:29PM

24
#19 - 梧桐王子 / WutongYujie

01/05/2018 at 03:38AM

24
#20 - Alphonse Mariya / alfunx

01/08/2018 at 10:13PM

24
#21 - Семён Марьясин / MaryasinS

01/12/2018 at 11:30AM

24
#22 - Lifepillar / lifepillar

05/10/2018 at 07:01PM

25
#23 - Jan Bundesmann / ixjab

12/15/2017 at 11:17AM

25
#24 - Bradley M. Small / BradleySmall

12/15/2017 at 11:51AM

25
#25 - gink / anagiwa

12/18/2017 at 07:58AM

25
#26 - BareTull / BareTull3

12/18/2017 at 04:45PM

25
#27 - Mateen Ulhaq / sicariusnoctis

06/10/2018 at 03:04AM

26
#28 - tPenguinLTG / tpenguinltg

12/15/2017 at 06:02AM

26
#29 - AleksandarTrifunovic / akstrfn

12/15/2017 at 08:34AM

26
#30 - Lajos Koszti / Ajnasz

12/15/2017 at 11:11AM