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):
26
#211 - Fabien C. / @vaga_io

05/18/2020 at 10:13AM

26
#212 - bigsystem / @bigsystem2

05/28/2020 at 02:55PM

26
#213 - Saurabh / @Saurabh09299

07/24/2020 at 06:35AM

26
#214 - Marcin Dostojewski / @MarcinekAGH

01/10/2021 at 02:33PM

26
#215 - Иван / @wansmer

04/21/2023 at 08:28AM

26
#216 - pajamaman7 aka tommyBuckets / @pajamaman7

02/22/2024 at 09:53PM

27
#217 - :wq / @write_quit_22

05/22/2021 at 01:19PM

27
#218 - 咸糖🎯 / @GIA917229015

01/04/2024 at 03:57PM

28
#219 - perTheGolfer / @GolferPer

03/03/2020 at 06:31PM

28
#220 - Shunichi Kanade / @shunkana

09/06/2020 at 10:59AM

28
#221 - Colby Morrison / @ColburnMorrison

09/16/2020 at 04:38AM

29
#222 - nick / @Xp_Bar

05/29/2020 at 03:34PM

29
#223 - Thomas Hiron / @thomashiron

02/20/2023 at 01:51PM

30
#224 - vimgolf_tmp_1 / @1Vimgolf

02/16/2020 at 03:58PM

30
#225 - lzh / @ly_zhng

06/14/2020 at 02:48AM

30
#226 - Joe Farnsworth / @JoeFarnsworth

06/22/2021 at 01:50AM

31
#227 - Bitt Faulk / @bittfaulk

02/21/2020 at 06:07PM

31
#228 - Victor Chen / @VictorC89422342

03/04/2020 at 07:43PM

31
#229 - MatsMaiwald / @MaiwaldMats

04/10/2020 at 10:28AM

31
#230 - Valdimar / @genkobar

06/01/2020 at 11:33PM

31
#231 - Jacob Shomstein / @jshoms

06/18/2020 at 04:24AM

32
#232 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 07:44PM

33
#233 - Jonathan Stinson / @KnightdeadJohn

02/28/2020 at 09:02AM

33
#234 - Ahmed Hasan / @ahmedrhasan

03/01/2020 at 04:36PM

33
#235 - Alexander Brömmer / @Superbort

03/20/2020 at 03:39PM

33
#236 - RaylanFox / @RaylanFox

04/05/2020 at 10:27AM

33
#237 - Manish Baghel / @ManishBaghelz

05/16/2020 at 01:08PM

33
#238 - Vinay Sridhar / @kewllip

03/31/2023 at 03:59PM

34
#239 - Mikael Brassman / @spoike

03/03/2020 at 04:24PM

34
#240 - Никита Семёнов / @NiKoS1707

09/24/2022 at 12:02PM