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):
23
#181 - kacper kazaniecki / @KacperKazan

03/13/2020 at 04:56PM

23
#182 - Tomas / @Tombakas

03/15/2020 at 08:18PM

23
#183 - Rustem B. / @_rustemb

07/31/2020 at 08:57AM

23
#184 - Christ / @Christ46234422

09/09/2020 at 12:59AM

23
#185 - Joshua Parco / @JoshuaParco2

11/19/2020 at 01:59PM

23
#186 - __VimGolfer__ / @VimGolfer19

11/26/2020 at 06:42PM

23
#187 - P37vo4WS / @p37vo4

12/30/2020 at 12:28PM

24
#188 - beew71493 / @beew71493

01/26/2020 at 01:13AM

24
#189 - 鏡崎ましろ / @KagamisakiMsr

01/27/2020 at 07:02AM

24
#190 - Chris League / @chrisleague

02/22/2020 at 09:32PM

24
#191 - Максим Селиверстов / @max_developer

03/03/2020 at 09:30AM

24
#192 - Austin Letson / @austin_letson

04/25/2020 at 05:03PM

24
#193 - Noxium / @NNNoxium

05/27/2020 at 03:55AM

24
#194 - drGsus / @drGsus

07/25/2020 at 01:38PM

24
#195 - Kaustubh Murumkar / @k_austub_h

08/30/2020 at 02:09PM

24
#196 - Ravi S Sinha / @ambidextrousTx

09/29/2020 at 01:19AM

24
#197 - 𝗙 ▲ 𝗥 𝗜 𝗦 𝗦 / @APsockes

10/12/2020 at 10:08AM

24
#198 - ._. / @Katharsic

04/25/2022 at 05:05PM

24
#199 - nickGPT / @nickandbro

08/24/2024 at 01:56PM

24
#200 - KoroneListener / @KoroneListener

09/04/2024 at 04:53PM

25
#201 - Gabe Pohl-Zaretsky / @GabeZaretsky

01/22/2020 at 08:11PM

25
#202 - dave / @onlygooddave

01/24/2020 at 06:47AM

25
#203 - できない子 / @smonkdonk

02/04/2020 at 09:06PM

25
#204 - Laurent Atlan / @laurentatlan1

03/03/2020 at 08:47PM

25
#205 - John Sumner / @rjsumner

04/29/2020 at 07:53PM

25
#206 - dule2607 / @dule26071

04/30/2020 at 10:18AM

25
#207 - Soumadeep Saha / @SoumadeepSaha8

05/10/2020 at 02:09AM

25
#208 - WladDalwM / @WladDalwM

03/04/2021 at 08:25PM

26
#209 - Nicolas / @martinni39

01/22/2020 at 08:34PM

26
#210 - {{ profile.name }} / @bytesonly

05/03/2020 at 08:02PM