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 4d1a8bf2b8cb3409320002c4

Search and Replace 0

Replace every instance of 'aaa' with 'xaaax'.

Start file
aaa
aab
abb
bbb
aaa
aab
abb
bbb
aaa
aab
abb
bbb
aaa
aab
abb
bbb
aaa
aab
abb
bbb
End file
xaaax
aab
abb
bbb
xaaax
aab
abb
bbb
xaaax
aab
abb
bbb
xaaax
aab
abb
bbb
xaaax
aab
abb
bbb

View Diff

1c1
< aaa
---
> xaaax
5c5
< aaa
---
> xaaax
9c9
< aaa
---
> xaaax
13c13
< aaa
---
> xaaax
17c17
< aaa
---
> xaaax

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 1629 remaining solutions by signing in and submitting your own entry
#1630 Heissen López / @heilop - Score: 140 - 06/15/20 @ 21:30
<Esc>%i<Esc>%<Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Esc>%/aaa/xaaax/g<CR><Up><Down><Esc>%/aaa/Replace<CR><CR><Esc>:%/aaa/xax<BS>aax/g<CR><Esc>:%s/aaa/xaaax/g<CR><Esc>:wq!<CR>

0 comments


Created by: @wolever

1630 active golfers, 5004 entries

Leaderboard (lowest score wins):
12
#91 - Karel Vervaeke / @karel1980

01/14/2011 at 11:12AM

12
#92 -  Ikhsan Maulana / @ixandidu

01/15/2011 at 07:13AM

12
#93 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 06:22PM

12
#94 - Gautam Rege / @gautamrege

01/21/2011 at 10:34AM

12
#95 - Oleg Roshupkin / @jjjahson

01/25/2011 at 01:09PM

12
#96 - Wesley Wong / @wesleymwwong

01/28/2011 at 08:10AM

12
#97 - Matthieu Honel / @ocus

01/28/2011 at 05:20PM

12
#98 - Matti Hänninen / @mjhanninen

01/30/2011 at 02:52PM

12
#99 - ImABigWookie / @imabigwookie

01/31/2011 at 04:58AM

12
#100 - xhtmlforum / @xhtmlforum

02/01/2011 at 09:33PM

12
#101 - Dmitry Teslenko / @krab_mozga

02/02/2011 at 09:58AM

12
#102 - Arthur Chiu / @arthur_chiu

02/06/2011 at 04:43PM

12
#103 - Pavlo Klets / @p01nt

02/24/2011 at 09:20PM

12
#104 - vg / @vimgolfer

02/26/2011 at 12:21PM

12
#105 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/20/2011 at 05:39AM

12
#106 - Jon Olick / @JonOlick

03/25/2011 at 06:16AM

12
#107 - Loc Nguyen / @Loc_Sic

03/30/2011 at 03:28PM

12
#108 - Frederik Mogensen / @fmogensen

03/31/2011 at 09:53AM

12
#109 - Wesley Beary / @geemus

04/03/2011 at 04:50AM

12
#110 - Craig H. Anderson / @CootCraig

04/20/2011 at 04:13PM

12
#111 - Emile Swarts / @EmileSwarts

04/23/2011 at 12:48PM

12
#112 - Shawn / @sartak

04/23/2011 at 07:07PM

12
#113 - Terje Larsen / @terlars

05/09/2011 at 12:55PM

12
#114 - kjrn / @kjrnleto

05/20/2011 at 08:21PM

12
#115 - wusher / @wusher

06/01/2011 at 02:20AM

12
#116 - Justin Love / @wondible

06/12/2011 at 07:27PM

12
#117 - James Gary / @james_gary

06/22/2011 at 11:10PM

12
#118 - Jonathan / @saysjonathan

06/30/2011 at 08:58PM

12
#119 - vimgolf / @vimgolf1

07/10/2011 at 05:45AM

12
#120 - Dave / @zzdave13

07/15/2011 at 04:58PM