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 53d1f9344ab5290002ab30e0

Subtraction

Solve the equations.

Start file
xx - x =
xxx - x =
xxxx - x =
xxxxx - x =
xxxxx - xx =
xxxxxx - xxxxx =
xxxxxxx - xx =
xxxxxxx - xx =
xxxxxxxx - xx =
xxxxxxxx - xxxxx =
xxxxxxxx - xxxxxx =
xxxxxxxxx - xxx =
xxxxxxxxxx - xxxxx =
xxxxxxxxxx - xxxxxxxx =
xxxxxxxxxxx - xxxx =
xxxxxxxxxxx - xxxxx =
xxxxxxxxxxxxx - xxxxxx =
xxxxxxxxxxxxxx - xxx =
xxxxxxxxxxxxxxx - xx =
xxxxxxxxxxxxxxxx - xxxxxxxx =
End file
xx - x = x
xxx - x = xx
xxxx - x = xxx
xxxxx - x = xxxx
xxxxx - xx = xxx
xxxxxx - xxxxx = x
xxxxxxx - xx = xxxxx
xxxxxxx - xx = xxxxx
xxxxxxxx - xx = xxxxxx
xxxxxxxx - xxxxx = xxx
xxxxxxxx - xxxxxx = xx
xxxxxxxxx - xxx = xxxxxx
xxxxxxxxxx - xxxxx = xxxxx
xxxxxxxxxx - xxxxxxxx = xx
xxxxxxxxxxx - xxxx = xxxxxxx
xxxxxxxxxxx - xxxxx = xxxxxx
xxxxxxxxxxxxx - xxxxxx = xxxxxxx
xxxxxxxxxxxxxx - xxx = xxxxxxxxxxx
xxxxxxxxxxxxxxx - xx = xxxxxxxxxxxxx
xxxxxxxxxxxxxxxx - xxxxxxxx = xxxxxxxx

View Diff

1,20c1,20
< xx - x =
< xxx - x =
< xxxx - x =
< xxxxx - x =
< xxxxx - xx =
< xxxxxx - xxxxx =
< xxxxxxx - xx =
< xxxxxxx - xx =
< xxxxxxxx - xx =
< xxxxxxxx - xxxxx =
< xxxxxxxx - xxxxxx =
< xxxxxxxxx - xxx =
< xxxxxxxxxx - xxxxx =
< xxxxxxxxxx - xxxxxxxx =
< xxxxxxxxxxx - xxxx =
< xxxxxxxxxxx - xxxxx =
< xxxxxxxxxxxxx - xxxxxx =
< xxxxxxxxxxxxxx - xxx =
< xxxxxxxxxxxxxxx - xx =
< xxxxxxxxxxxxxxxx - xxxxxxxx =
---
> xx - x = x
> xxx - x = xx
> xxxx - x = xxx
> xxxxx - x = xxxx
> xxxxx - xx = xxx
> xxxxxx - xxxxx = x
> xxxxxxx - xx = xxxxx
> xxxxxxx - xx = xxxxx
> xxxxxxxx - xx = xxxxxx
> xxxxxxxx - xxxxx = xxx
> xxxxxxxx - xxxxxx = xx
> xxxxxxxxx - xxx = xxxxxx
> xxxxxxxxxx - xxxxx = xxxxx
> xxxxxxxxxx - xxxxxxxx = xx
> xxxxxxxxxxx - xxxx = xxxxxxx
> xxxxxxxxxxx - xxxxx = xxxxxx
> xxxxxxxxxxxxx - xxxxxx = xxxxxxx
> xxxxxxxxxxxxxx - xxx = xxxxxxxxxxx
> xxxxxxxxxxxxxxx - xx = xxxxxxxxxxxxx
> xxxxxxxxxxxxxxxx - xxxxxxxx = xxxxxxxx

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 39 remaining solutions by signing in and submitting your own entry
#40 Bill Booth / ohiopyle - Score: 30 - 08/19/14 @ 08:16
:%s/\v(x+)(x+) - \2 \=/& \1<CR>ZZ

0 comments

#41 Dmitriy / _dpy_ - Score: 30 - 08/19/14 @ 18:12
:%s/\v(x+)(x+) - \2 \=/& \1<CR>ZZ

0 comments

#42 eBrnd / eBrnd - Score: 30 - 11/02/14 @ 21:15
qq0ye2w:map X <C-R><C-W><CR>A <Esc>pXjq19@qZZ

0 comments

#43 Lieven Keersmaekers / LievenKeersmaek - Score: 31 - 07/27/14 @ 16:08
/\v(x*) - \1<CR>:%norm ny0A <C-V><Esc>p<CR>ZZ

0 comments

#44 madka / lachrimae_pavan - Score: 31 - 08/03/14 @ 12:12
:<Up>%s/\v(x+)(x+) - \2 \=/& \1<CR>ZZ

0 comments

#45 Dario Avitabile / tutticapaci - Score: 32 - 09/08/14 @ 13:17
qq"aywwwy/\W<CR>A <C-R>a<Esc>?<C-R>" <CR>Dwq19@qZZ

0 comments

#46 Kai Wood / kwd_io - Score: 35 - 07/25/14 @ 07:39
qqyiw$p3byiw2w:norm <C-R>"<CR>i <Esc>0jq19@qZZ

0 comments

#47 Ricardo M. Vilchis / ajkaanbal - Score: 35 - 07/25/14 @ 16:33
qaywo<Esc>pk2wywjo<Esc>ph<C-V>k0dkJ$xjddq19@aZZ

0 comments

#48 Florian Duraffourg / fduraffourg - Score: 41 - 07/28/14 @ 19:51
:%s/\(x*\)\(x*\) - \2 =/\1\2 - \2 = \1<CR>ZZ

0 comments

#49 Dan Oneata / DanOneata - Score: 83 - 07/26/14 @ 09:12
:norem Q "1ywww"2ywA <C-r>=repeat('x',len('<C-r>1')-len('<C-r>2'))<CR><CR>VG:norm Q<CR>ZZ

0 comments

Created by: Caek_

49 active golfers, 137 entries

Leaderboard (lowest score wins):
18
#1 - Urtica dioica / udioica

07/25/2014 at 10:12AM

18
#2 - Birkir Ólafsson / Birkirlafsson

07/25/2014 at 08:18PM

18
#3 - Petro Тrouq / zulolosi

07/26/2014 at 04:29AM

18
#4 - Adit Cahya Ramadhan / aditcr8

07/27/2014 at 01:19AM

18
#5 - Maximiliano Padulo / mpadulo

07/29/2014 at 09:04AM

18
#6 - John Braxler / braxler

07/29/2014 at 02:40PM

18
#7 - Caek / Caek_

09/19/2014 at 12:16AM

18
#8 - Rui Mendes / rcm_dium

05/02/2015 at 01:25PM

19
#9 - John Meisner / jmeisned

07/25/2014 at 08:31PM

19
#10 - ———đίxίє—flαтlίиє——— / _dixie_flatline

08/15/2014 at 06:47PM

19
#11 - Saki Gw / Sakigw

01/23/2017 at 12:00AM

20
#12 - Bambu / bambumandinga

07/30/2014 at 12:47AM

20
#13 - Jeff / just_geophree

09/13/2014 at 10:05PM

22
#14 - Kerson Hsiao / KersonHsiao

07/25/2014 at 07:30AM

22
#15 - Kai Yuan / kentyuan

07/25/2014 at 09:12AM

22
#16 - Pete Johns / johnsyweb

07/26/2014 at 04:57AM

22
#17 - Michi Loro / michiloro

07/28/2014 at 11:24AM

22
#18 - vimgolf copycat / vimgolf_copycat

07/28/2014 at 04:27PM

22
#19 - gybilis / gybilis

07/29/2014 at 08:38PM

22
#20 - kemar / le_kemar

08/22/2014 at 12:24PM

22
#21 - Matthieu Crapet / mcr05

02/27/2015 at 02:07PM

22
#22 - pftb12345 / pftb12345

04/11/2015 at 03:45PM

23
#23 - Marco Biasini / biasmv

07/27/2014 at 05:45PM

23
#24 - booom / ateukme

08/20/2014 at 11:32PM

23
#25 - Walker Boh / walker_boh

11/26/2015 at 11:21AM

24
#26 - oliver mueller / marcontwit

07/25/2014 at 08:38AM

24
#27 - Grigoriy Alexeev / GrigoriyAlexeev

08/03/2014 at 12:27PM

25
#28 - Marcin Sza / coot_

07/27/2014 at 01:02AM

26
#29 - Carlos López / morrizon

07/26/2014 at 07:00PM

26
#30 - Seth Rader / f4uLT

08/13/2014 at 06:47PM

26
#31 - April Gentle / chen327684096

08/24/2014 at 03:38PM

26
#32 - Adrien Canuel / AdrienCanuel

11/20/2014 at 09:16AM

27
#33 - Heath Patterson / HeathPatterson

07/25/2014 at 06:14PM

27
#34 - Spy / thatspysaspy

07/28/2014 at 05:37PM

28
#35 - Ram Tamtam / ramtamtamtam

07/25/2014 at 12:06PM

28
#36 - Chris Yuen / kizzx2

07/26/2014 at 11:58AM

30
#37 - Javier Blanco / jbgutierrez

07/29/2014 at 10:06PM

30
#38 - Tj / yrddy

08/13/2014 at 06:19AM

30
#39 - robinro / robinro

08/19/2014 at 07:09AM

30
#40 - Bill Booth / ohiopyle

08/19/2014 at 08:16AM

30
#41 - Dmitriy / _dpy_

08/19/2014 at 06:12PM

30
#42 - eBrnd / eBrnd

11/02/2014 at 09:15PM

31
#43 - Lieven Keersmaekers / LievenKeersmaek

07/27/2014 at 04:08PM

31
#44 - madka / lachrimae_pavan

08/03/2014 at 12:12PM

32
#45 - Dario Avitabile / tutticapaci

09/08/2014 at 01:17PM

35
#46 - Kai Wood / kwd_io

07/25/2014 at 07:39AM

35
#47 - Ricardo M. Vilchis / ajkaanbal

07/25/2014 at 04:33PM

41
#48 - Florian Duraffourg / fduraffourg

07/28/2014 at 07:51PM

83
#49 - Dan Oneata / DanOneata

07/26/2014 at 09:12AM