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 77 remaining solutions by signing in and submitting your own entry
#78 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

78 active golfers, 209 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 / @sh3llcode

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

23
#12 - Daniël De Koker / @daniel_koker

07/02/2018 at 08:06AM

23
#13 - h3is3nd3rp / @h3is3nd3rp

08/02/2018 at 12:23PM

23
#14 - fucus / @fishlovebanana

08/25/2018 at 01:58PM

23
#15 - name / @name65894813

11/23/2018 at 06:46PM

24
#16 - Smylers / @Smylers2

12/15/2017 at 12:59PM

24
#17 - John Braxler / @braxler

12/15/2017 at 02:17PM

24
#18 - Jon Krause / @jkrause314

12/15/2017 at 03:34PM

24
#19 - Sage san / @sagesancast

12/17/2017 at 08:15PM

24
#20 - Saki Gw / @Sakigw

12/19/2017 at 02:00PM

24
#21 - deepak / @utopianmonk

12/22/2017 at 10:01AM

24
#22 - BarbaJol / @drpproteus

12/30/2017 at 05:29PM

24
#23 - 梧桐王子 / @WutongYujie

01/05/2018 at 03:38AM

24
#24 - Alphonse Mariya / @alfunx

01/08/2018 at 10:13PM

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

01/12/2018 at 11:30AM

24
#26 - Lifepillar / @lifepillar

05/10/2018 at 07:01PM

24
#27 - fsj / @FrogzSJ

08/12/2018 at 06:14PM

24
#28 - Dax / @zacoxi

11/16/2018 at 06:49AM

25
#29 - Jan Bundesmann / @janbundesmann

12/15/2017 at 11:17AM

25
#30 - Bradley M. Small / @BradleySmall

12/15/2017 at 11:51AM