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):
12
#91 - Dax / @zacoxi

11/22/2018 at 01:49AM

12
#92 - Alex / @AlexanderHeatl2

05/21/2022 at 09:18PM

13
#93 - tPenguinLTG / @tpenguinltg

09/07/2016 at 02:02AM

13
#94 - tgmeng / @lazy_fabric

09/07/2016 at 02:38AM

13
#95 - Cristian Lupașcu / @clupasq

09/07/2016 at 06:43AM

13
#96 - Shivam Sharma / @getshivam

09/07/2016 at 08:19AM

13
#97 - Jan Bundesmann / @janbundesmann

09/07/2016 at 08:28AM

13
#98 - Walker Boh / @walker_boh

09/07/2016 at 08:34AM

13
#99 - Utkrisht Dhankar / @UtkrishtDhankar

09/07/2016 at 08:43AM

13
#100 - イーサン / @metakirby5

09/07/2016 at 09:49AM

13
#101 - Stanislav / @prstad

09/07/2016 at 12:37PM

13
#102 - hor1ace / @hor3ace

09/07/2016 at 01:34PM

13
#103 - Lifepillar / @lifepillar

09/07/2016 at 08:23PM

13
#104 - Winfried Puchinger / @winpuc

09/09/2016 at 09:59AM

13
#105 - 馬 / @uma0124

09/09/2016 at 03:34PM

13
#106 - Bruce Park / @bpark0

09/09/2016 at 06:56PM

13
#107 - tetor / @t_etor

09/09/2016 at 08:17PM

13
#108 - captain_morgan / @captain_morgan

09/11/2016 at 06:43PM

13
#109 - Constantine / @ConstantineHatz

09/12/2016 at 05:52PM

13
#110 - Matt Michnal / @mgm702

09/12/2016 at 09:56PM

13
#111 - James / @Dronak

09/13/2016 at 11:56AM

13
#112 - Finn Francis / @FinnFrancis

09/16/2016 at 09:09AM

13
#113 - Rasmus / @SBareSSomErMig

09/16/2016 at 07:40PM

13
#114 - Ameer Ayoub / @magicmeeror

09/16/2016 at 09:36PM

13
#115 - Bendik Samseth / @BSamseth

09/19/2016 at 01:15PM

13
#116 - Allen Gooch / @mojochao

09/20/2016 at 11:39PM

13
#117 - Daniel Bellenger / @DanielBellenger

09/24/2016 at 10:38PM

13
#118 - René De Alvarado / @renedealvarado

09/27/2016 at 12:52PM

13
#119 - Jörg Meyer / @JoergMy

10/01/2016 at 03:57PM

13
#120 - Test User / @TestUserIgnore

10/17/2016 at 08:48PM