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):
14
#121 - Christian Guenter / @chris_guenter

09/09/2016 at 05:32PM

14
#122 - Søren / @natlampen

09/20/2016 at 04:09PM

14
#123 - Alex Ulitin / @inventivealex

09/23/2016 at 02:37AM

14
#124 - Koudougou / @OpenPatate

09/23/2016 at 02:19PM

14
#125 - Clalani / @clalania

10/14/2016 at 10:55AM

14
#126 - myjunkmails / @myjunkmails

11/24/2016 at 05:35AM

14
#127 - Marcel Akkerman / @MarcelAkkerman

12/29/2016 at 08:10AM

14
#128 - Paul Draghicescu / @pdragy

03/23/2018 at 12:00AM

14
#129 - Aaron / @_Lordofthevoid_

12/10/2019 at 08:47PM

15
#130 - luffy / @raxcoi

09/10/2016 at 05:22PM

15
#131 - Joël Christ / @jjlchrist

10/07/2016 at 07:32PM

15
#132 - TweetDreams / @TweetMusicians

10/08/2016 at 10:18AM

15
#133 - mnx / @mnxx

11/14/2016 at 02:58PM

15
#134 - Arijus / @argshook

04/19/2018 at 12:19PM

15
#135 - Ivo Blöchliger / @aigledesalpes

08/18/2019 at 08:06PM

16
#136 - AODQ / @AODQIG

09/07/2016 at 10:39PM

16
#137 - Hans Yelek / @hans_yelek

01/10/2017 at 05:08AM

16
#138 - Stop and think / @ms_uncountable

07/07/2017 at 11:27AM

16
#139 - John C Shea / @MHSSachems

01/14/2018 at 01:12PM

17
#140 - JungChoon Park / @unlimitedfocus

09/08/2016 at 06:17PM

17
#141 - George Angelopoulos / @g_usermod

09/20/2016 at 07:37PM

17
#142 - Carl Egbert / @CarlOEgbert

06/11/2017 at 11:06PM

17
#143 - Jurica / @Jurica34581259

11/16/2018 at 04:55PM

18
#144 - Batuhan Bayrakçı / @bay_batu

09/18/2016 at 02:29PM

18
#145 - Meriadec Pillet / @loomisBroom

09/27/2016 at 11:30AM

19
#146 - herbage / @herbage2

12/17/2016 at 02:35PM

19
#147 - Gurukandhamoorthi / @Gurukandhamoor1

07/10/2017 at 02:54PM

24
#148 - Netrisk Cool / @C00lt0

09/29/2016 at 06:09PM

26
#149 - king_zorba / @StrangeZorba

09/22/2016 at 02:37PM

52
#150 - Matt Walsh / @wattmalsh

02/08/2017 at 08:07AM