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

177 active golfers, 626 entries

Leaderboard (lowest score wins):
23
#121 - Tomas / @Tombakas

03/15/2020 at 08:18PM

23
#122 - Rustem B. / @_rustemb

07/31/2020 at 08:57AM

23
#123 - Christ / @Christ46234422

09/09/2020 at 12:59AM

24
#124 - beew71493 / @beew71493

01/26/2020 at 01:13AM

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

01/27/2020 at 07:02AM

24
#126 - Chris League / @chrisleague

02/22/2020 at 09:32PM

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

03/03/2020 at 09:30AM

24
#128 - Austin Letson / @austin_letson

04/25/2020 at 05:03PM

24
#129 - Noxium / @NNNoxium

05/27/2020 at 03:55AM

24
#130 - drGsus / @drGsus

07/25/2020 at 01:38PM

24
#131 - Kaustubh Murumkar / @k_austub_h

08/30/2020 at 02:09PM

25
#132 - Gabe Pohl-Zaretsky / @GabeZaretsky

01/22/2020 at 08:11PM

25
#133 - dave / @onlygooddave

01/24/2020 at 06:47AM

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

02/04/2020 at 09:06PM

25
#135 - Laurent Atlan / @laurentatlan1

03/03/2020 at 08:47PM

25
#136 - John Sumner / @rjsumner

04/29/2020 at 07:53PM

25
#137 - dule2607 / @dule26071

04/30/2020 at 10:18AM

25
#138 - Soumadeep Saha / @SoumadeepSaha8

05/10/2020 at 02:09AM

26
#139 - Nicolas 👨‍💻🇨🇦 / @martinni39

01/22/2020 at 08:34PM

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

05/03/2020 at 08:02PM

26
#141 - Fabien C. / @vaga_io

05/18/2020 at 10:13AM

26
#142 - bigsystem / @bigsystem2

05/28/2020 at 02:55PM

26
#143 - Saurabh / @Saurabh09299

07/24/2020 at 06:35AM

28
#144 - perTheGolfer / @GolferPer

03/03/2020 at 06:31PM

28
#145 - Shunichi Kanade / @shunkana

09/06/2020 at 10:59AM

28
#146 - Colby Morrison / @ColburnMorrison

09/16/2020 at 04:38AM

29
#147 - nick / @Xp_Bar

05/29/2020 at 03:34PM

30
#148 - vimgolf_tmp_1 / @1Vimgolf

02/16/2020 at 03:58PM

30
#149 - lzh / @ly_zhng

06/14/2020 at 02:48AM

31
#150 - Bitt Faulk / @bittfaulk

02/21/2020 at 06:07PM