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

237 active golfers, 828 entries

Leaderboard (lowest score wins):
22
#151 - drumstix576 / @drumstix576

11/20/2020 at 07:10PM

22
#152 - hepebexè / @hepebexe

11/30/2020 at 10:31PM

22
#153 - Jon Powers / @JonKPowers

12/15/2020 at 07:42PM

22
#154 - John Doe / @JohnDoe75830353

12/24/2020 at 02:06AM

22
#155 - Björn Struckmeier / @BjrnStruckmeie1

01/07/2021 at 12:43PM

22
#156 - 영훈 / @odjfnrtm

01/19/2021 at 01:04AM

22
#157 - grsh / @girish_i_am

05/28/2021 at 07:22PM

22
#158 - 0xNinja / @0x_Ninja

08/17/2021 at 01:40PM

23
#159 - Hector Davensburg / @hdavensburg

01/26/2020 at 12:46PM

23
#160 - Aníbal / @anibal10

02/02/2020 at 10:42AM

23
#161 - Sander Vanhove / @SanderVhove

02/05/2020 at 09:12AM

23
#162 - TheSemicolon / @the_semicolon_

02/25/2020 at 05:20PM

23
#163 - kacper kazaniecki / @KacperKazan

03/13/2020 at 04:56PM

23
#164 - Tomas / @Tombakas

03/15/2020 at 08:18PM

23
#165 - Rustem B. / @_rustemb

07/31/2020 at 08:57AM

23
#166 - Christ / @Christ46234422

09/09/2020 at 12:59AM

23
#167 - Joshua Parco / @JoshuaParco2

11/19/2020 at 01:59PM

23
#168 - __VimGolfer__ / @VimGolfer19

11/26/2020 at 06:42PM

23
#169 - P37vo4WS / @p37vo4

12/30/2020 at 12:28PM

24
#170 - beew71493 / @beew71493

01/26/2020 at 01:13AM

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

01/27/2020 at 07:02AM

24
#172 - Chris League / @chrisleague

02/22/2020 at 09:32PM

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

03/03/2020 at 09:30AM

24
#174 - Austin Letson / @austin_letson

04/25/2020 at 05:03PM

24
#175 - Noxium / @NNNoxium

05/27/2020 at 03:55AM

24
#176 - drGsus / @drGsus

07/25/2020 at 01:38PM

24
#177 - Kaustubh Murumkar / @k_austub_h

08/30/2020 at 02:09PM

24
#178 - Ravi S Sinha / @ambidextrousTx

09/29/2020 at 01:19AM

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

10/12/2020 at 10:08AM

24
#180 - ._. / @Katharsic

04/25/2022 at 05:05PM