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 5486c522908f4600023c53fa

Test everything!

... and build the desired input data structure. Transform a list of values into a non-trivial format.

Start file
        { changed_field => 'lorem', old_value => 'a', new_value => 'b' },
lorem ipsum dolor sit amet elitr sed diam non umy eir mod tempor invi dunt lab ore
dol1 dol2 dol3 dol4 dol5 dol6 dol7 dol8 dol9 dol10 mag1 mag2 mag3 mag4 mag5 mag6 mag7 mag8 mag9 mag10
End file
        { changed_field => 'lorem', old_value => 'a', new_value => 'b' },
        { changed_field => 'ipsum', old_value => 'a', new_value => 'b' },
        { changed_field => 'dolor', old_value => 'a', new_value => 'b' },
        { changed_field => 'sit', old_value => 'a', new_value => 'b' },
        { changed_field => 'amet', old_value => 'a', new_value => 'b' },
        { changed_field => 'elitr', old_value => 'a', new_value => 'b' },
        { changed_field => 'sed', old_value => 'a', new_value => 'b' },
        { changed_field => 'diam', old_value => 'a', new_value => 'b' },
        { changed_field => 'non', old_value => 'a', new_value => 'b' },
        { changed_field => 'umy', old_value => 'a', new_value => 'b' },
        { changed_field => 'eir', old_value => 'a', new_value => 'b' },
        { changed_field => 'mod', old_value => 'a', new_value => 'b' },
        { changed_field => 'tempor', old_value => 'a', new_value => 'b' },
        { changed_field => 'invi', old_value => 'a', new_value => 'b' },
        { changed_field => 'dunt', old_value => 'a', new_value => 'b' },
        { changed_field => 'lab', old_value => 'a', new_value => 'b' },
        { changed_field => 'ore', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol1', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol2', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol3', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol4', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol5', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol6', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol7', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol8', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol9', old_value => 'a', new_value => 'b' },
        { changed_field => 'dol10', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag1', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag2', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag3', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag4', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag5', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag6', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag7', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag8', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag9', old_value => 'a', new_value => 'b' },
        { changed_field => 'mag10', old_value => 'a', new_value => 'b' },

View Diff

2,3c2,37
< lorem ipsum dolor sit amet elitr sed diam non umy eir mod tempor invi dunt lab ore
< dol1 dol2 dol3 dol4 dol5 dol6 dol7 dol8 dol9 dol10 mag1 mag2 mag3 mag4 mag5 mag6 mag7 mag8 mag9 mag10
---
>         { changed_field => 'ipsum', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dolor', old_value => 'a', new_value => 'b' },
>         { changed_field => 'sit', old_value => 'a', new_value => 'b' },
>         { changed_field => 'amet', old_value => 'a', new_value => 'b' },
>         { changed_field => 'elitr', old_value => 'a', new_value => 'b' },
>         { changed_field => 'sed', old_value => 'a', new_value => 'b' },
>         { changed_field => 'diam', old_value => 'a', new_value => 'b' },
>         { changed_field => 'non', old_value => 'a', new_value => 'b' },
>         { changed_field => 'umy', old_value => 'a', new_value => 'b' },
>         { changed_field => 'eir', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mod', old_value => 'a', new_value => 'b' },
>         { changed_field => 'tempor', old_value => 'a', new_value => 'b' },
>         { changed_field => 'invi', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dunt', old_value => 'a', new_value => 'b' },
>         { changed_field => 'lab', old_value => 'a', new_value => 'b' },
>         { changed_field => 'ore', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol1', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol2', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol3', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol4', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol5', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol6', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol7', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol8', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol9', old_value => 'a', new_value => 'b' },
>         { changed_field => 'dol10', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag1', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag2', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag3', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag4', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag5', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag6', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag7', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag8', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag9', old_value => 'a', new_value => 'b' },
>         { changed_field => 'mag10', old_value => 'a', new_value => 'b' },

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 53 remaining solutions by signing in and submitting your own entry
#54 RetirePlanner / @RetirePlanner24 - Score: 83 - 12/09/14 @ 15:17
^^f'v^hhhhhhhhhhhhy:2,3s/ /\r/g<CR>:s<BS>2,$s/^/<C-R>"/<CR>ggf';v$y:2,$s/$/<C-R>"<BS>/<CR>ggdd:w<CR>:wq<BS>q<BS><BS>q<CR>

0 comments


Created by: @Someone_Busy

54 active golfers, 186 entries

Leaderboard (lowest score wins):
22
#1 - Urtica dioica / @udioica

12/09/2014 at 11:05AM

22
#2 - John Braxler / @braxler

12/09/2014 at 06:46PM

22
#3 - Petro Тrouq / @zulolosi

12/11/2014 at 08:14PM

22
#4 - jared swarts / @JaredSwarts

12/12/2014 at 10:49PM

22
#5 - kok / @kok89428331

03/10/2021 at 02:30PM

22
#6 - Peppa Pig / @PeppaPi95550250

07/03/2024 at 03:28AM

22
#7 - nickGPT / @nickandbro

08/28/2024 at 04:51AM

23
#8 - Jon Krause / @jkrause314

01/17/2016 at 11:55PM

23
#9 - Alonzo / @tolver_a

02/02/2017 at 01:07AM

23
#10 - Jean George / @JeanGeo20504212

11/10/2023 at 12:14AM

23
#11 - Berel94 / @Berel94

03/25/2024 at 08:40PM

24
#12 - Kai Yuan / @kentyuan

12/09/2014 at 11:18AM

24
#13 - Arijus / @argshook

08/02/2018 at 12:59PM

25
#14 - Matt / @mcr05

12/10/2014 at 08:35PM

25
#15 - kobby / @_kafdot_

12/10/2014 at 10:23PM

25
#16 - Carlos A Henríquez Q / @lagunex

01/17/2015 at 06:26PM

25
#17 - Charles A. Bouffard / @the_cabouffard

04/05/2015 at 08:22PM

25
#18 - pftb12345 / @pftb12345

04/11/2015 at 01:06AM

25
#19 - z00master / @z00master

08/22/2022 at 05:26PM

26
#20 - Matt Robbins / @mcrmfc

12/11/2014 at 06:05PM

26
#21 - Mauro Persano / @fzort

06/05/2015 at 11:49PM

27
#22 - Carlos López / @morrizon

01/04/2015 at 05:55PM

29
#23 - Pierre Houssin / @PierreHoussin

12/11/2014 at 12:28AM

29
#24 - RockerZZY / @rocker_zzy

06/06/2020 at 03:21AM

31
#25 - Ricardo M. Vilchis / @ajkaanbal

12/09/2014 at 03:58PM

31
#26 - Alex / @AlexanderHeatl2

07/08/2022 at 08:34PM

32
#27 - Simon Tost / @Someone_Busy

12/09/2014 at 10:38AM

32
#28 - YNWP / @ynw_P

12/09/2014 at 10:11PM

32
#29 - Daniel Rødskog / @daniero

12/10/2014 at 09:02PM

32
#30 - xieyh11 / @xieyh11

02/28/2015 at 10:01AM