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

Hogwarts Email Sorting

Given a list of emails, get the students full name and their associated house.

Start file
james.potter@gryffindor.hogwarts.edu
sirius.black@gryffindor.hogwarts.edu
lily.potter@gryffindor.hogwarts.edu
draco.malfoy@slytherin.hogwarts.edu
harry.potter@gryffindor.hogwarts.edu
susan.bones@hufflepuff.hogwarts.edu
luna.lovegood@ravenclaw.hogwarts.edu
pansy.parkinson@slytherin.hogwarts.edu
cedric.diggory@hufflepuff.hogwarts.edu
cho.chang@hufflepuff.hogwarts.edu
End file
James Potter Gryffindor
Sirius Black Gryffindor
Lily Potter Gryffindor
Draco Malfoy Slytherin
Harry Potter Gryffindor
Susan Bones Hufflepuff
Luna Lovegood Ravenclaw
Pansy Parkinson Slytherin
Cedric Diggory Hufflepuff
Cho Chang Hufflepuff

View Diff

1,10c1,10
< james.potter@gryffindor.hogwarts.edu
< sirius.black@gryffindor.hogwarts.edu
< lily.potter@gryffindor.hogwarts.edu
< draco.malfoy@slytherin.hogwarts.edu
< harry.potter@gryffindor.hogwarts.edu
< susan.bones@hufflepuff.hogwarts.edu
< luna.lovegood@ravenclaw.hogwarts.edu
< pansy.parkinson@slytherin.hogwarts.edu
< cedric.diggory@hufflepuff.hogwarts.edu
< cho.chang@hufflepuff.hogwarts.edu
---
> James Potter Gryffindor
> Sirius Black Gryffindor
> Lily Potter Gryffindor
> Draco Malfoy Slytherin
> Harry Potter Gryffindor
> Susan Bones Hufflepuff
> Luna Lovegood Ravenclaw
> Pansy Parkinson Slytherin
> Cedric Diggory Hufflepuff
> Cho Chang Hufflepuff

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 176 remaining solutions by signing in and submitting your own entry
#177 Christophe Kafrouni / @KafrouniChris - Score: 590 - 04/29/20 @ 16:06
:%s<CR>:%s/\([<50-53>vimgolf put 5e2786a9ee9d370009f72c0a<Esc>[201~<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><50-53>[a-z]*\<Esc>[201~<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~uuuu<50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~<50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~uuuu:<50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><CR>:<50-53>%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<Esc>[201~<CR>:<50-53>:wq<Esc>[201~<CR>

0 comments


Created by: @ujwalnarayan

177 active golfers, 626 entries

Leaderboard (lowest score wins):
22
#91 - brightlyopen / @brightlyopen

02/22/2020 at 08:48PM

22
#92 - David Hume / @djh95

02/26/2020 at 09:53PM

22
#93 - William Profit / @william_profit

03/13/2020 at 03:12PM

22
#94 - Sean Dewar / @seandewar

03/13/2020 at 04:18PM

22
#95 - vtls / @vtls16

03/14/2020 at 12:57PM

22
#96 - asierrayk / @asierrayk

03/14/2020 at 01:35PM

22
#97 - Ryan Nevius / @ryannevius

03/17/2020 at 05:21PM

22
#98 - Rodrigo V. Lopes / @rodvlopes

03/28/2020 at 02:35AM

22
#99 - bluemartian / @bluemartianz59

03/29/2020 at 02:37PM

22
#100 - fedja golf / @FedjaGolf

04/13/2020 at 02:37AM

22
#101 - 廖彥智 / @JeffYenchih

04/15/2020 at 10:03AM

22
#102 - volandkit / @volandkit

04/20/2020 at 06:22PM

22
#103 - Jorge Romeu Huidobro / @jorgerom_

05/12/2020 at 03:47PM

22
#104 - Jan Fiser / @dmmn082

05/12/2020 at 06:21PM

22
#105 - a quiet misdreavus / @QuietMisdreavus

05/13/2020 at 06:40PM

22
#106 - Ebi / @ehan6

05/21/2020 at 07:02PM

22
#107 - David Bragmark / @DBragmark

05/29/2020 at 07:37PM

22
#108 - Yannick / @Yannick88147038

06/01/2020 at 05:58PM

22
#109 - RockerZZY / @rocker_zzy

06/07/2020 at 03:04AM

22
#110 - Brennan Barker / @BrennanJBarker

07/05/2020 at 04:11AM

22
#111 - Tiago Nascimento / @tigum27

07/18/2020 at 06:09PM

22
#112 - Jeff Cui / @jeffacce

07/27/2020 at 09:12AM

22
#113 - Martin Bielik / @mabielik

08/10/2020 at 07:45PM

22
#114 - This is a sniff free zone / @electronjunkie

08/16/2020 at 01:04PM

22
#115 - Till Straube / @tillstr

08/18/2020 at 04:50PM

23
#116 - Hector Davensburg / @hdavensburg

01/26/2020 at 12:46PM

23
#117 - Aníbal / @anibal10

02/02/2020 at 10:42AM

23
#118 - Sander Vanhove / @SanderVhove

02/05/2020 at 09:12AM

23
#119 - TheSemicolon / @the_semicolon_

02/25/2020 at 05:20PM

23
#120 - kacper kazaniecki / @KacperKazan

03/13/2020 at 04:56PM