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):
15
#151 - Arijus / @argshook

04/19/2018 at 12:19PM

15
#152 - Ivo Blöchliger / @aigledesalpes

08/18/2019 at 08:06PM

16
#153 - AODQ / @AODQIG

09/07/2016 at 10:39PM

16
#154 - Hans Yelek / @hans_yelek

01/10/2017 at 05:08AM

16
#155 - Stop and think / @ms_uncountable

07/07/2017 at 11:27AM

16
#156 - John C Shea / @MHSSachems

01/14/2018 at 01:12PM

17
#157 - JungChoon Park / @unlimitedfocus

09/08/2016 at 06:17PM

17
#158 - George Angelopoulos / @g_usermod

09/20/2016 at 07:37PM

17
#159 - Carl Egbert / @CarlOEgbert

06/11/2017 at 11:06PM

17
#160 - Jurica / @Jurica34581259

11/16/2018 at 04:55PM

18
#161 - Batuhan Bayrakçı / @bay_batu

09/18/2016 at 02:29PM

18
#162 - Meriadec Pillet / @loomisBroom

09/27/2016 at 11:30AM

19
#163 - herbage / @herbage2

12/17/2016 at 02:35PM

19
#164 - Gurukandhamoorthi / @Gurukandhamoor1

07/10/2017 at 02:54PM

24
#165 - Netrisk Cool / @C00lt0

09/29/2016 at 06:09PM

26
#166 - king_zorba / @StrangeZorba

09/22/2016 at 02:37PM

52
#167 - Matt Walsh / @wattmalsh

02/08/2017 at 08:07AM