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 57cf3e398c660c1f8f014717

Paragraph breaks

Swap the blank lines and the aaa lines.

Start file
aa
a
aaa

aa
a
aaa

aa
a
aaa

aa
a
End file
aa
a

aaa
aa
a

aaa
aa
a

aaa
aa
a

View Diff

Looking for a hint? I'm not giving one!

Looking for a diff? Not giving that either.

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 149 remaining solutions by signing in and submitting your own entry
#150 Matt Walsh / @wattmalsh - Score: 52 - 02/08/17 @ 08:07
:%s/aaa\|^$/\=submatch(0) == "aaa" ? "" : "aaa"/g<CR>ZZ

0 comments


Created by: @udioica

150 active golfers, 424 entries

Leaderboard (lowest score wins):
10
#31 - ParasamGateZero / @ParasamGateZero

02/19/2018 at 04:51AM

10
#32 - slicklash / @slicklash

04/19/2018 at 12:28PM

10
#33 - Vytautas Jakutis / @jakutis0

04/19/2018 at 12:31PM

10
#34 - Daniël De Koker / @daniel_koker

07/04/2018 at 10:38PM

10
#35 - alekfed / @alek_fed

04/16/2019 at 09:36AM

10
#36 - majo senf / @majo_senf

06/21/2019 at 01:45PM

10
#37 - vimgolfer / @vimgolfer7

10/04/2019 at 03:35AM

10
#38 - Miłosz Łakomy / @foobar01123

12/15/2019 at 09:25AM

11
#39 - Jon Krause / @jkrause314

09/07/2016 at 06:25AM

11
#40 - Smylers / @Smylers2

09/08/2016 at 08:24AM

11
#41 - Alessio Linares / @alessio_linares

09/08/2016 at 02:29PM

11
#42 - Anoop Kumar / @anooplive

09/09/2016 at 05:42PM

11
#43 - Marvin Samson / @fresapore

09/09/2016 at 07:50PM

11
#44 - Ken Schmidt / @Maigard

09/09/2016 at 10:52PM

11
#45 - Petro Тrouq / @zulolosi

09/10/2016 at 05:55AM

11
#46 - Benjamin Schindler / @beschindler

09/10/2016 at 07:44AM

11
#47 - Peter / @sunirbmag

09/10/2016 at 09:17AM

11
#48 - ✘A / @Lolicon_H

09/11/2016 at 04:28AM

11
#49 - Shahaf A / @Av3r4ge

09/12/2016 at 12:32PM

11
#50 - ♜ Pepe Doval / @pepellou

09/13/2016 at 03:53PM

11
#51 - Rizart Dokollari / @rdokollari

09/14/2016 at 12:02PM

11
#52 - Vaughn Cato / @vaughncato

09/15/2016 at 01:05PM

11
#53 - Allen57 / @ludo57310

09/18/2016 at 02:05PM

11
#54 - javier castro / @eusipial

09/19/2016 at 04:30AM

11
#55 - Patrick Davey / @psdavey

09/21/2016 at 08:31AM

11
#56 - poke / @useraaaaaaaaaaf

10/06/2016 at 02:39PM

11
#57 - Christian Rondeau / @c_rondeau

10/16/2016 at 03:02AM

11
#58 - Bill Ruddock / @biinari

10/31/2016 at 02:14AM

11
#59 - KangHun Seo / @shirano80

10/31/2016 at 03:01AM

11
#60 - Davis Fields / @i301585

11/04/2016 at 11:57PM