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):
35
#241 - fff / @fff51460170

02/20/2021 at 07:09AM

37
#242 - Peter Tran / @Fulton_Jewelry

03/21/2020 at 12:25AM

37
#243 - Quark / @PuzzleQuark

03/23/2020 at 11:43PM

37
#244 - candywrappercrane / @cndwrpprpprcrn

06/12/2020 at 08:33PM

37
#245 - Theo Sarrazin / @tshaero

08/18/2020 at 01:25PM

39
#246 - Anthony BERNARD / @TweetTontony

02/16/2020 at 08:31PM

39
#247 - Mack Hutsell / @sellshuts

05/24/2020 at 07:28PM

42
#248 - Nathan Hartman / @hnathan918

04/02/2020 at 08:00PM

42
#249 - vito / @vito49999722

08/01/2020 at 08:16AM

43
#250 - Derrick Anderson - Solstice / @DerrickSolstice

05/14/2020 at 11:59PM

43
#251 - rats is a cool name / @cd_rum

12/09/2020 at 01:47AM

47
#252 - Sina Khalili / @sinathagreat

02/17/2020 at 12:56PM

47
#253 - Christophe Robillard / @krichtof

06/01/2020 at 03:47PM

47
#254 - dotvimrc / @dotvimrc1

06/19/2020 at 06:46AM

47
#255 - abhijeet patil / @abhijeetptl5

09/04/2020 at 09:54AM

52
#256 - math is what I hate / @mpnmbn

03/13/2022 at 11:10AM

55
#257 - Justus Thane / @justusthane

05/12/2021 at 03:20PM

61
#258 - Alvaro Melendez / @alvaromelendezh

02/21/2020 at 04:39PM

65
#259 - rolando / @ro1_ando

03/31/2020 at 11:04PM

168
#260 - Pranshu Goyal / @PranshuGoyal

01/17/2021 at 08:13AM

252
#261 - Orsós Ádám / @adamspindle

06/17/2022 at 10:45AM

590
#262 - Christophe Kafrouni / @KafrouniChris

04/29/2020 at 04:06PM