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

0 comments


Created by: @udioica

167 active golfers, 522 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

10
#39 - RockerZZY / @rocker_zzy

06/20/2020 at 02:49AM

10
#40 - Jianfeng / @Jianfen22425058

01/31/2021 at 08:49AM

10
#41 - Jung Yeon Park / @park_jungy

02/12/2021 at 10:50PM

10
#42 - 김범준 / @kmbmjn

02/17/2021 at 06:29AM

10
#43 - A A A / @37fatos

03/11/2021 at 11:12PM

10
#44 - Janzen / @__Coos

10/01/2022 at 01:25PM

10
#45 - Peppa Pig / @PeppaPigSg

05/28/2024 at 03:39AM

10
#46 - nickGPT / @nickandbro

08/28/2024 at 03:05AM

11
#47 - Jon Krause / @jkrause314

09/07/2016 at 06:25AM

11
#48 - "Smylers" / @Smylers2

09/08/2016 at 08:24AM

11
#49 - Alessio Linares / @alessio_linares

09/08/2016 at 02:29PM

11
#50 - Anoop Kumar / @anooplive

09/09/2016 at 05:42PM

11
#51 - Marvin Samson / @fresapore

09/09/2016 at 07:50PM

11
#52 - Ken Schmidt / @Maigard

09/09/2016 at 10:52PM

11
#53 - Petro Тrouq / @zulolosi

09/10/2016 at 05:55AM

11
#54 - Benjamin Schindler / @beschindler

09/10/2016 at 07:44AM

11
#55 - Peter / @sunirbmag

09/10/2016 at 09:17AM

11
#56 - ✘A / @Lolicon_H

09/11/2016 at 04:28AM

11
#57 - Shahaf A / @Av3r4ge

09/12/2016 at 12:32PM

11
#58 - ♜ Pepe Doval / @pepellou

09/13/2016 at 03:53PM

11
#59 - Rizart Dokollari / @rdokollari

09/14/2016 at 12:02PM

11
#60 - Vaughn Cato / @vaughncato

09/15/2016 at 01:05PM