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

155 active golfers, 561 entries

Leaderboard (lowest score wins):
20
#1 - Saki Gw / @Sakigw

01/22/2020 at 10:41AM

20
#2 - Smylers / @Smylers2

01/22/2020 at 11:14AM

20
#3 - Ollin Boer Bohan / @madebyollin

01/22/2020 at 03:07PM

20
#4 - Ujwal Narayan / @ujwalnarayan

01/22/2020 at 04:17PM

20
#5 - Karnival K / @K4rnival

01/22/2020 at 07:31PM

20
#6 - Tefe / @tefetic

01/24/2020 at 05:47PM

20
#7 - John Braxler / @braxler

01/24/2020 at 07:30PM

20
#8 - Daniel Simionato / @weseven

01/26/2020 at 12:34PM

20
#9 - nicosierra / @nicosierra84

01/26/2020 at 10:30PM

20
#10 - Kyle X. Clark / @KyXr_Clark

01/26/2020 at 11:24PM

20
#11 - Oleg / @colega

01/28/2020 at 08:49PM

20
#12 - Jean-Francois Parent / @hacker_pyrat

01/31/2020 at 12:59AM

20
#13 - bruiser / @bruiserwins

02/02/2020 at 12:03AM

20
#14 - jrddp / @jrddp0

02/13/2020 at 05:16PM

20
#15 - howanto / @ho_wan_

02/18/2020 at 01:56PM

20
#16 - Ard / @kokojarjar

02/18/2020 at 02:19PM

20
#17 - yhetsugiHMC / @yhetsugi

02/20/2020 at 02:19AM

20
#18 - Strages / @Strages2k

02/23/2020 at 02:04AM

20
#19 - countime / @countime1

03/05/2020 at 03:01AM

20
#20 - Toby Hawkins / @Toby_Hawkins

03/15/2020 at 12:30AM

20
#21 - Niklas Ydebäck / @Ydebaeck

03/16/2020 at 11:43PM

20
#22 - Marco / @Marco24456514

03/21/2020 at 11:13PM

20
#23 - Ryan Burmeister-Morrison / @rburmorrison

04/11/2020 at 09:48PM

20
#24 - edvrds / @edvrds

04/14/2020 at 09:51AM

20
#25 - Moatvald / @moatvald

04/17/2020 at 11:33AM

20
#26 - せいほう / @FICSQF

04/22/2020 at 02:15AM

20
#27 - Arthur Goodman / @ArthurGoodman3

04/30/2020 at 08:39AM

20
#28 - Jake Van Alstyne / @jake_va

05/11/2020 at 06:48PM

20
#29 - Jonáš Šerých / @serycjon

05/13/2020 at 01:32PM

20
#30 - Samir Khan / @stats_samir

05/15/2020 at 10:41PM