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

262 active golfers, 928 entries

Leaderboard (lowest score wins):
20
#31 - 于吉星 / @fishermryn

05/25/2020 at 09:00AM

20
#32 - Robberechts Arne / @ArneRobberechts

06/14/2020 at 07:30PM

20
#33 - majo senf / @majo_senf

07/21/2020 at 07:34AM

20
#34 - speisz / @speiszc

07/22/2020 at 09:17PM

20
#35 - fenn.stefan@gmail.com / @FennStefan

08/25/2020 at 08:10PM

20
#36 - Blake Tereau / @BlakeTereau

09/09/2020 at 03:26AM

20
#37 - akouryy / @akouryy1

09/16/2020 at 02:18AM

20
#38 - lamtt77 / @lamtt77

10/10/2020 at 05:21AM

20
#39 - vim-golf-requirement / @VRequirement

10/14/2020 at 03:59PM

20
#40 - noam teyssier / @noamteyssier

10/15/2020 at 06:17PM

20
#41 - Jon Krause / @jkrause314

10/26/2020 at 05:02AM

20
#42 - David Kutschke / @D4KU_

11/21/2020 at 10:53AM

20
#43 - quemeraisc / @quemeraisc

11/24/2020 at 08:55AM

20
#44 - Dax / @zacoxi

12/16/2020 at 03:52AM

20
#45 - Jung Yeon Park / @park_jungy

01/04/2021 at 02:18PM

20
#46 - Austin Scott / @theMetgame

01/11/2021 at 12:45AM

20
#47 - 蔡徐坤真是爱吃屎 / @Hashub7

01/21/2021 at 12:39PM

20
#48 - Andreas Siegrist / @andreaszwei

01/23/2021 at 10:49PM

20
#49 - Arya Kumar / @SusSquirrel

05/19/2021 at 04:31PM

20
#50 - Roman Privalov / @RomanPrivalov

09/19/2021 at 03:54PM

20
#51 - dorianm / @dorianm

05/08/2022 at 03:51AM

20
#52 - russellzhaomao / @russellzhaomao

05/24/2022 at 08:12AM

20
#53 - Janzen / @__Coos

10/06/2022 at 04:26PM

20
#54 - Fabio Ortega / @_Ortega

04/05/2023 at 04:14PM

20
#55 - moh ayaya / @AyayaMoh

08/30/2023 at 05:36PM

20
#56 - Luoyb / @Luoyb

10/27/2023 at 05:42AM

20
#57 - scpchicken / @scpchick

11/08/2023 at 07:04PM

20
#58 - Aly Thobani / @alythobani

05/30/2024 at 12:35AM

20
#59 - Peppa Pig / @PeppaPigSg

07/02/2024 at 06:41AM

20
#60 - efettf / @efettf

11/01/2024 at 08:50PM