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):
21
#91 - MySelf / @okmslf

10/21/2020 at 04:12PM

21
#92 - Alice / @Alice92541388

10/22/2020 at 01:52AM

21
#93 - chocolate / @chocola81394123

12/03/2020 at 02:35AM

21
#94 - roudens / @roudens2

12/20/2020 at 02:39PM

21
#95 - Ray Dennis / @raysden

12/24/2020 at 02:18PM

21
#96 - A A A / @37fatos

01/10/2021 at 07:54PM

21
#97 - ytrxc38754975 / @royaso

05/22/2021 at 03:21AM

21
#98 - pikjes / @pikjes2

07/15/2021 at 12:47PM

21
#99 - Scott Berger / @scottberger

09/24/2021 at 06:52PM

21
#100 - Vahan / @Vahan00900245

10/06/2021 at 01:28PM

21
#101 - Francois Marais / @maraisf

10/07/2021 at 08:24PM

21
#102 - ややお / @yayaoh

01/16/2022 at 08:21AM

21
#103 - Alex / @AlexanderHeatl2

07/06/2022 at 09:41PM

21
#104 - z00master / @z00master

08/17/2022 at 03:28PM

21
#105 - مرجان / @IEnfantTerribIe

08/03/2023 at 06:10PM

21
#106 - naka / @nak38223985244

01/12/2024 at 02:13PM

21
#107 - luke37842 / @luke37842

05/16/2024 at 10:00AM

22
#108 - Derek Schrock / @derekschrock

01/21/2020 at 11:34PM

22
#109 - Vim太郎@Vim入門 管理人 / @VimTry

01/22/2020 at 02:34AM

22
#110 - Felix Boers / @felixboers

01/22/2020 at 07:17AM

22
#111 - Jan Bundesmann / @janbundesmann

01/22/2020 at 08:32AM

22
#112 - mowglian / @mowglian

01/22/2020 at 09:35AM

22
#113 - Rune Warhuus / @DinkDonkNorway

01/22/2020 at 12:21PM

22
#114 - Thomas Jung / @ThomasAJung

01/22/2020 at 05:37PM

22
#115 - Jason Neylon / @jasonneylon

01/22/2020 at 07:45PM

22
#116 - Brent Westbrook / @westbrook_brent

01/22/2020 at 09:29PM

22
#117 - みなもと / @sminamot

01/23/2020 at 01:45PM

22
#118 - Tom van der Lee / @TomVdLee

01/23/2020 at 02:07PM

22
#119 - Andre / @5starsmug

01/24/2020 at 12:17PM

22
#120 - Tinko Minko / @tandikula

01/24/2020 at 09:56PM