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):
22
#151 - RockerZZY / @rocker_zzy

06/07/2020 at 03:04AM

22
#152 - Brennan Barker / @BrennanJBarker

07/05/2020 at 04:11AM

22
#153 - Tiago Nascimento / @tigum27

07/18/2020 at 06:09PM

22
#154 - Jeff Cui / @jeffacce

07/27/2020 at 09:12AM

22
#155 - Martin Bielik / @mabielik

08/10/2020 at 07:45PM

22
#156 - Put me on your list tyrants / @electronjunkie

08/16/2020 at 01:04PM

22
#157 - Till Straube / @tillstr

08/18/2020 at 04:50PM

22
#158 - mevmev / @mevmev8

10/02/2020 at 10:57PM

22
#159 - The Valencian Dev / @thevalenciandev

10/13/2020 at 09:12AM

22
#160 - Ifeoluwa Lawal / @IfeLawl

10/14/2020 at 03:44PM

22
#161 - Leo Winters / @LeoPWinters

10/19/2020 at 06:39PM

22
#162 - Demian Martinez / @demianuco

11/02/2020 at 10:12AM

22
#163 - Zack Freedman / @freedman_zack

11/07/2020 at 09:44PM

22
#164 - drumstix576 / @drumstix576

11/20/2020 at 07:10PM

22
#165 - hepebexè / @hepebexe

11/30/2020 at 10:31PM

22
#166 - Jon Powers / @JonKPowers

12/15/2020 at 07:42PM

22
#167 - John Doe / @JohnDoe75830353

12/24/2020 at 02:06AM

22
#168 - Björn Struckmeier / @BjrnStruckmeie1

01/07/2021 at 12:43PM

22
#169 - 영훈 / @odjfnrtm

01/19/2021 at 01:04AM

22
#170 - grsh / @girish_i_am

05/28/2021 at 07:22PM

22
#171 - 0xNinja / @0x_Ninja

08/17/2021 at 01:40PM

22
#172 - Brandon / @Brandon10678836

08/28/2022 at 11:27PM

22
#173 - James / @Dronak

11/17/2022 at 08:33PM

22
#174 - かみひろ / @km_hr

03/30/2024 at 02:02AM

22
#175 - Elliot Schemmel / @regulated

10/11/2024 at 08:06PM

22
#176 - mindgitrwx / @mindgitrwx

12/22/2024 at 08:55AM

23
#177 - Hector Davensburg / @hdavensburg

01/26/2020 at 12:46PM

23
#178 - Aníbal / @anibal10

02/02/2020 at 10:42AM

23
#179 - Sander Vanhove / @SanderVhove

02/05/2020 at 09:12AM

23
#180 - TheSemicolon / @the_semicolon_

02/25/2020 at 05:20PM