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):
13
#121 - John Barbero Unenge / @JBarberU

11/09/2016 at 02:24PM

13
#122 - Saki Gw / @Sakigw

11/10/2016 at 03:32PM

13
#123 - BlackCap / @BlackCapCoder

11/23/2016 at 04:18PM

13
#124 - Richard Mörbitz / @Lodifice

12/08/2016 at 10:50PM

13
#125 - holy_sin / @0zero0

12/16/2016 at 07:50AM

13
#126 - Michał Dytko / @DytkoM

12/20/2016 at 08:31AM

13
#127 - Yann / @yannstad

02/21/2017 at 07:00AM

13
#128 - Mitchell / @Spitchell

03/18/2017 at 04:39PM

13
#129 - Avijit Gupta / @526avijit

03/25/2017 at 06:33AM

13
#130 - caplod / @caplod

03/25/2017 at 07:39PM

13
#131 - Brian Hall / @_bruab_

05/06/2017 at 06:05PM

13
#132 - Rami Hovi / @hacker_lawyer

05/16/2017 at 09:54AM

13
#133 - Chicuella / @chicuellahere

06/06/2017 at 10:55AM

13
#134 - John Smith / @johns32768

06/21/2017 at 05:43PM

13
#135 - Geoff / @RealGeoffErwin

12/18/2017 at 08:30PM

13
#136 - :wq / @write_quit_22

06/29/2021 at 03:12AM

14
#137 - Christian Guenter / @chris_guenter

09/09/2016 at 05:32PM

14
#138 - Søren / @natlampen

09/20/2016 at 04:09PM

14
#139 - Alex Ulitin / @inventivealex

09/23/2016 at 02:37AM

14
#140 - Koudougou / @OpenPatate

09/23/2016 at 02:19PM

14
#141 - Clalani / @clalania

10/14/2016 at 10:55AM

14
#142 - myjunkmails / @myjunkmails

11/24/2016 at 05:35AM

14
#143 - Marcel Akkerman / @MarcelAkkerman

12/29/2016 at 08:10AM

14
#144 - Paul Draghicescu / @pdragy

03/23/2018 at 12:00AM

14
#145 - Aaron / @_Lordofthevoid_

12/10/2019 at 08:47PM

14
#146 - jonas-grobe / @jonas-grobe

02/03/2024 at 10:13PM

15
#147 - luffy / @raxcoi

09/10/2016 at 05:22PM

15
#148 - Joël Christ / @jjlchrist

10/07/2016 at 07:32PM

15
#149 - TweetDreams / @TweetMusicians

10/08/2016 at 10:18AM

15
#150 - mnx / @mnxx

11/14/2016 at 02:58PM