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):
61
#61 - Guillaume Seren / guillaumeseren

04/18/2018 at 07:49AM

74
#62 - BitLad / BitLad

01/31/2018 at 03:40PM

90
#63 - Dominic Z / thammaaa

12/21/2017 at 09:10AM