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):
11
#61 - Allen57 / @ludo57310

09/18/2016 at 02:05PM

11
#62 - javier castro / @eusipial

09/19/2016 at 04:30AM

11
#63 - Patrick Davey / @psdavey

09/21/2016 at 08:31AM

11
#64 - poke / @useraaaaaaaaaaf

10/06/2016 at 02:39PM

11
#65 - Christian Rondeau / @c_rondeau

10/16/2016 at 03:02AM

11
#66 - Bill Ruddock / @biinari

10/31/2016 at 02:14AM

11
#67 - 정품비아그라 / @shirano80

10/31/2016 at 03:01AM

11
#68 - Davis Fields / @i301585

11/04/2016 at 11:57PM

11
#69 - timerella® / @timerella

11/16/2016 at 11:24PM

11
#70 - Zhihong Liu / @pieapple03

02/15/2017 at 12:42AM

11
#71 - Dimitar Ivanov / @dimisthoughts

03/20/2017 at 12:54AM

11
#72 - Zachary Neubert / @Mr_Saturn16347

03/24/2017 at 12:22AM

11
#73 - Remus Dalrymple / @bornintheflames

05/06/2017 at 11:56PM

11
#74 - Lukas Galke / @_lpag

05/31/2017 at 10:08PM

11
#75 - Ben Hill / @KaizenSoze70

06/30/2017 at 08:58PM

11
#76 - Frank Malone / @FrankMa00268686

07/27/2017 at 12:17PM

11
#77 - SVG / @dotnose5

10/29/2017 at 02:07AM

11
#78 - DHM / @DHM29978992

04/28/2018 at 02:41AM

11
#79 - name / @name65894813

11/25/2018 at 04:18AM

11
#80 - Mihai / @mihaicristiant

12/24/2018 at 06:25PM

11
#81 - Chester Yap / @Chest_ErYap

08/03/2019 at 07:27PM

11
#82 - Lory / @Lory46845742

11/21/2019 at 08:35AM

11
#83 - hepebexè / @hepebexe

02/21/2021 at 08:17PM

11
#84 - pikjes / @pikjes2

03/21/2021 at 08:02PM

11
#85 - Jean George / @JeanGeo20504212

01/07/2022 at 01:00PM

11
#86 - z00master / @z00master

08/19/2022 at 06:20AM

11
#87 - Omar Alawadhi / @OmarAla59544225

10/19/2022 at 05:03PM

11
#88 - moh ayaya / @AyayaMoh

09/29/2023 at 04:35PM

12
#89 - Chris / @Gaunah_

09/07/2016 at 09:09AM

12
#90 - Igor Czerwinski / @igoratron

10/23/2016 at 01:33PM