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

Change the content of a string

This docstring is a complete lie. Fix it.

Start file
def add(a, b):
    """ Subtracts "x" from "y" """
    return a + b
End file
def add(a, b):
    """ Adds "a" to "b" """
    return a + b

View Diff

2c2
<     """ Subtracts "x" from "y" """
---
>     """ Adds "a" to "b" """

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 371 remaining solutions by signing in and submitting your own entry
#372 engy / engydmw - Score: 27 - 09/25/13 @ 21:10
j2wcwAdds<Esc>2wra2wcwto<Esc>2wrbZZ

0 comments


#373 wilddog64 / chengkai318 - Score: 27 - 12/17/13 @ 20:42
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#374 pikaren / REALpikaren - Score: 27 - 01/03/14 @ 03:29
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#375 jgpaiva / jgpaiva - Score: 27 - 01/31/14 @ 11:39
jfScwAdds<Esc>fxrawwcwto<Esc>fyrbZZ

0 comments


#376 skensell / skensell - Score: 27 - 04/27/14 @ 09:12
/S<CR>cwAdds<Esc>fxrafyrbBBcwto<Esc>ZZ

0 comments


#377 Talya S / _tomata - Score: 27 - 07/27/14 @ 14:09
jfScwAdds<Esc>fxrawwcwto<Esc>fyrbZZ

0 comments


#378 Jake Worth / jwworth - Score: 27 - 01/02/15 @ 23:12
:2s/S.*y/Adds "a" to "b/<CR>ZZ

0 comments


#379 lpm11 / T. Tsunoda / lpm11 - Score: 27 - 02/16/15 @ 11:57
/S<CR>cwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#380 Jeffrey Gu / Jeffrey_Gu - Score: 27 - 03/20/15 @ 16:54
j2wceAdds<Esc>fxraffceto<Esc>fyrbZZ

0 comments


#381 Valentino / iv_alentino - Score: 27 - 03/20/15 @ 16:55
j2wceAdds<Esc>fxraffceto<Esc>fyrbZZ

0 comments


#382 Jack Yeh / tinyhousejack - Score: 27 - 03/20/15 @ 16:55
jwwceAdds<Esc>wwrawwceto<Esc>wwrbZZ

0 comments


#383 luffy / raxcoi - Score: 27 - 06/07/15 @ 20:59
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#384 Gerald Tilma / GeraldTilma - Score: 27 - 10/20/15 @ 02:09
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#385 Bogumił Kamiński / BogumilKaminski - Score: 27 - 05/04/16 @ 21:35
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#386 quiggy🌹 / quiggy - Score: 27 - 05/19/16 @ 19:47
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#387 Kyouma / kyoumaJohn - Score: 27 - 10/14/16 @ 19:45
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#388 Daniel / Daniel00288663 - Score: 27 - 03/30/17 @ 14:03
jfSceAdds<Esc>fxrafyrbFfceto<Esc>ZZ

0 comments


#389 Gurukandhamoorthi / Gurukandhamoor1 - Score: 27 - 07/13/17 @ 11:45
/S<CR>cwAdds<Esc>fxrafyrbFfcwto<Esc>ZZ

0 comments


#390 Moritz Manner / moritz_manner - Score: 27 - 01/01/18 @ 18:45
jfScwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#391 Romain D. / r_dulery - Score: 27 - 02/06/18 @ 19:30
jwwc/""<CR>Adds "a" to "b" <Esc>ZZ

0 comments


#392 Austin Ware / AustinWare17 - Score: 27 - 03/13/18 @ 02:17
/S<CR>cwAdds<Esc>fxraffcwto<Esc>fyrbZZ

0 comments


#393 William Hamilton / BobHamiltonijk - Score: 27 - 05/26/18 @ 02:11
/S<CR>v/y<CR>cAdds "a" to "b<Esc>:wq<CR>

0 comments


#394 lionel young / lionelyoung - Score: 28 - 12/28/10 @ 23:42
jWWRAdds "a" to "b<Esc>ld3wZZ

0 comments


#395 eolo999 / eolo999 - Score: 28 - 12/29/10 @ 00:04
/S<CR>cfyAdds "a" to "b<Esc>:wq<CR>

0 comments


#396 Martin Pugh / s3krit - Score: 28 - 12/29/10 @ 02:11
j8lcfyAdds "a" to "b<Esc>:wq<CR>

0 comments


#397 Hung Huu Hoang / hungh3 - Score: 28 - 12/30/10 @ 07:36
:2s/S.*y/Adds "a" to "b<CR>:wq<CR>

0 comments


#398 Jan B. / bracki - Score: 28 - 01/03/11 @ 22:27
jfScwAdds<Esc>2wra2wcwto<Right><Right><Right><BS>b<Esc>ZZ

0 comments


#399 Wesley Wong / wesleymwwong - Score: 28 - 01/29/11 @ 21:59
j2wcwAdds<Esc>2wra2wcwto<Esc>2wrb<Esc>ZZ

0 comments


#400 Sergey Kim / skim1776 - Score: 28 - 08/22/11 @ 09:00
j2WcwAdds<Esc>2wra2wcwto<Esc>2wrb<Esc>ZZ

0 comments


#401 ise0615 / ise0615 - Score: 28 - 05/04/12 @ 17:23
jwwRAdds "a" to "b"<Esc>lv7lhdZZ

0 comments


#402 curist / curist - Score: 28 - 07/09/13 @ 08:06
/S<CR>cwAdds<Right><Right><Del>a<C-C><C-C>Wcwto<Right><Right><Del>b<C-C><C-C>ZZ

0 comments


#403 Oliver Christ / 0liverChrist - Score: 28 - 09/25/13 @ 15:19
jfScwAdds<Right><Right><Del>a<Right><Right><Esc>lcwto<Esc>fyrbZZ

0 comments


#404 Bjorn / bjorn_248 - Score: 28 - 11/15/13 @ 21:01
jwwvWWwwwcAdds "a" to "b"<Esc>ZZ

0 comments


#405 z0c / zerocabal - Score: 28 - 06/12/18 @ 08:58
jWWvEEEEdiAdds "a" to "b"<Esc>ZZ

0 comments


#406 Jason Gilman / axodys - Score: 29 - 12/29/10 @ 00:43
j2wc8wAdds "a" to "b"<Esc>:wq<CR>

0 comments


#407 Simon Brown / caelyxsec - Score: 29 - 12/29/10 @ 06:49
jfSc4f Adds "a" to "b" <Esc>ZZ

0 comments


#408 Joe Hassick / jhassick - Score: 29 - 12/29/10 @ 17:41
8wcwAdds<Esc>2wra2wcwto<Esc>2wrbZZ

0 comments


#409 TchiKong / tchikong - Score: 29 - 01/23/11 @ 11:22
/S<CR>cwAdds<Esc>wwrawwcwto<Esc>wwrb:wq<CR>

0 comments


#410 Ed Gibbs / edward_gibbs - Score: 29 - 08/18/11 @ 02:46
/S<CR>RAdds "a" to "b" """<Esc><Right>d$ZZ

0 comments


#411 Dave Lyon / daveisonthego - Score: 29 - 09/16/11 @ 01:07
/S<CR>cwAdds<Esc>3lra9<Esc>ffcwto<Esc>3lrbZZ

0 comments


#412 Daniel Harrington / rubiii - Score: 29 - 12/10/11 @ 19:46
/S<CR>cwAdds<Esc>fxraffcwto<Esc>fyrb:wq<CR>

0 comments


#413 Nick Bakkegaard / Bakkemand - Score: 29 - 11/26/12 @ 23:59
jwwdeiAdds<Esc>fxrawwdeito<Esc>fyrbZZ

0 comments


#414 Chenut Ludovic / 7Brwa7 - Score: 29 - 03/31/16 @ 16:43
jfSdtsiAdd<Esc>fxraff2xRto<Esc>fyrbZZ

0 comments


#415 Max Del Giudice / max_forest - Score: 29 - 04/18/16 @ 08:51
jwC""" Adds "a" to "b" """<Esc>ZZ

0 comments


#416 Ronuk Raval / rraval - Score: 30 - 12/28/10 @ 23:29
jfSd4t"iAdds "a" to "b<Esc>:wq<CR>

0 comments


#417 Stefan Borsje / sborsje - Score: 30 - 12/28/10 @ 23:53
/S<CR>c4f"Adds "a" to "b"<Esc>:wq<CR>

0 comments


#418 Phil / phil30075 - Score: 30 - 12/29/10 @ 04:18
j:s/\vS.{20}/Adds "a" to "b<CR>ZZ

0 comments


#419 pcapriotti / pcapriotti - Score: 30 - 12/29/10 @ 11:47
j2wcwAdds<Esc>2wra2wcwto<Esc>2wrbZZ

0 comments


#420 Daniel Hahler / blueyed - Score: 30 - 12/29/10 @ 19:23
/S<CR>c/""<CR>Adds "a" to "b" <Esc>ZZ

0 comments


#421 Amir Hedayaty / hedayaty - Score: 30 - 12/30/10 @ 12:33
j^C""" Adds "a" to "b" """<Esc>:x<CR>

0 comments


#422 Tim Andersson / Boerworz - Score: 30 - 04/19/11 @ 21:44
jfScwAdds<Esc>fxraffcwto<Esc>fyrb<Esc>:wq<CR>

0 comments


#423 Scott Myц / ScottMuc - Score: 30 - 04/07/13 @ 05:01
jWWcwAdds<Esc>/x<CR>ra<Esc>Wcwto<Esc><Esc>/y<CR>rbZZ

0 comments


#424 Justin Knag / justinknag - Score: 30 - 08/28/14 @ 14:53
jfScwAdds<C-C><C-C>fxraffcwto<C-C><C-C>tylrbZZ

0 comments


#425 David Wolever / wolever - Score: 31 - 12/28/10 @ 23:27
jfSCAdds "a" to "b" """<Esc>:wq<CR>

0 comments


#426 Paul Tarjan / ptarjan - Score: 31 - 12/29/10 @ 11:35
/S<CR>d$aAdds "a" to "b" """<Esc>ZZ

0 comments


#427 leprechaun / irishlinuxgeek - Score: 31 - 12/29/10 @ 18:57
/S<CR>cwAdds<Esc>fxraWcwto<Esc>fyrb:wq<CR>

0 comments


#428 garygordon / garygordon - Score: 31 - 01/01/11 @ 19:25
jwwcwAdds<Esc>wwcwa<Esc>wwcwto<Esc>wwcwb<Esc>ZZ

0 comments


#429 rdt / rdtft - Score: 31 - 02/07/11 @ 23:16
/S<CR>dwiAdds <Esc>fxraffdwito <Esc>fyrbZZ

0 comments


#430 Alex Kolesnikov / k0lesman - Score: 31 - 05/01/11 @ 00:31
/S<CR>cwAdds<Insert><Right><Right>a<Right><Right>to<Esc><Right>xx<Insert><Right><Right>b<Right><Esc>x:x<CR>

0 comments


#431 Bjørn Einar Bjartnes / bjartnes - Score: 31 - 01/27/12 @ 13:44
jfSdwiAdds <Esc>llrawwdwito <Esc>llrbZZ

0 comments


#432 Joe McCall / joem86 - Score: 32 - 12/29/10 @ 01:09
j2wcwAdds<Esc>fxrawwcwto<Esc>fyrb:wq<CR>

0 comments


#433 Peter Krenn / peterkrenn - Score: 32 - 12/29/10 @ 01:24
jfScwAdds<Esc>fxraffcwto<Esc>fyrb:wq<CR>

0 comments


#434 Tyler Wymer / twymer - Score: 32 - 12/29/10 @ 02:27
jWWcwAdds<Esc>WlraWcwto<Esc>Wlrb<Esc>:wq<CR>

0 comments


#435 Chris Metcalf / chrismetcalf - Score: 32 - 12/29/10 @ 04:32
jwwcwAdds<Esc>wwrawwcwto<Esc>wwrb:wq<CR>

0 comments


#436 Rasmus P / rasmup - Score: 32 - 12/29/10 @ 17:11
jfScwAdds<Esc>fxraffcwto<Esc>fyrb:wq<CR>

0 comments


#437 Unsouled / unsouled0 - Score: 32 - 12/30/10 @ 03:09
/S<CR>cwAdds<Esc>wlrawwcwto<Esc>wlrb:wq<CR>

0 comments


#438 David / ddddddddavid - Score: 32 - 12/30/10 @ 05:05
/S<CR>cwAdds<Esc>fxraffcwto<Esc>fyrb:wq<CR>

0 comments


#439 Daniel Grippi / danielgrippi - Score: 32 - 01/02/11 @ 16:33
4WdwiAdds <Right><Right><BS>a<Esc>Wdwito <Esc>llxib<Esc>:x<CR>

0 comments


#440 dschobel / dschobel - Score: 33 - 12/29/10 @ 07:52
j/S<CR>cwAdds<Esc>3lra3lcwto<Esc>3lrb:wq<CR>

0 comments


#441 Ajith Antony / ajithantony - Score: 33 - 12/29/10 @ 13:03
/S<CR>cwAdds<Esc>fxraffcwto<Esc>fyrb<Esc>:wq<CR>

0 comments


#442 sorami / boredoms - Score: 33 - 04/30/11 @ 21:48
jfScwAdds<C-C><C-C>fxrawwcwto<C-C><C-C>wwrb<C-C><C-C>:wq<CR>

0 comments


#443 Cartney McLennon / mepsi_pax - Score: 34 - 12/29/10 @ 01:31
/S<CR>cwAdds<Esc>fxrawwcwto<Esc>fyrb<Esc>:wqa<CR>

0 comments


#444 drio / drio - Score: 34 - 12/30/10 @ 10:42
jfSdwiAdds <Esc>llra<Esc>ffdwito <Esc>llrb<Esc>:x<CR>

0 comments


#445 Pawka / Pawka - Score: 34 - 01/16/11 @ 11:26
/s<CR>dwiAdds <Esc>fxraffdWito <Esc>fyrb<Esc>:wq<CR>

0 comments


#446 id / tunguska112 - Score: 34 - 07/24/14 @ 09:40
+llllcwAdds<Esc>lllralllcwto<Esc>lllrb:wq<CR>

0 comments


#447 正攻法なボクでいく / Eiryyy - Score: 34 - 11/25/14 @ 06:52
jfsdawiAdds <Esc>llrafmdawito <Esc>llrb<Esc>ZZ

0 comments


#448 Antonio Lucca / tonyxzt - Score: 35 - 12/29/10 @ 00:27
jfxrafyrbbbcwto<Esc>bbbbbcwAdds<Esc>:wq<CR>

0 comments


#449 Jesse Brown / bionicpill - Score: 35 - 12/29/10 @ 00:43
/S<CR>dwiAdds <Esc>llrallldwito <Esc>llrb<Esc>:wq<CR>

0 comments


#450 John Reitano / johnreitano - Score: 35 - 12/29/10 @ 00:50
/S<CR>cwAdds<Esc>fxraffcwto<Esc>fyrb<Esc>:w<CR>:q<CR>

0 comments


#451 Samuel / Namgnoi - Score: 35 - 01/31/13 @ 21:32
/s<CR>dwiAdds <Esc>llra/f<CR>dwito <Esc>llrb<Esc>:wq<CR>

0 comments


#452 Alfredo Deza / alfredodeza - Score: 36 - 12/29/10 @ 01:33
/S<CR>ctsAdd<Esc>fxraffcwto<Esc>fyrb<Esc>:wq<CR>

0 comments


#453 Steve Klabnik / steveklabnik - Score: 36 - 12/29/10 @ 03:10
jfSvf"f"f"llcAdds "a" to "b"<Esc>:wq<CR>

0 comments


#454 Hendrik Nigul / nigulh - Score: 38 - 12/29/10 @ 13:40
/S<CR>dwiAdds <Esc>Wlra/f<CR>dwito <Esc>[C<Esc>llrb<Esc>zzZZ

0 comments


#455 Rohit Nair / rohitnair - Score: 40 - 12/29/10 @ 03:39
<Down>wwdwiAdds <Esc>wwsa<Esc>wwdw<Esc>ito <Esc>wwsb<Esc>:x<CR>

0 comments


#456 Timothy Hahn / timyhahn - Score: 44 - 04/20/12 @ 03:52
/S<CR>ceAdds<Esc>:%s/x/a<CR>%:%s/y/b<CR>:%s/from/to<CR><Esc>:wq<CR>

0 comments


#457 Pete O'Grady / peteog - Score: 46 - 01/04/11 @ 11:35
j:s/Subtracts/Adds<CR>:s/x/a<CR>:s/y/b<CR>:s/from/to<CR>ZZ

0 comments


#458 Folke Lemaitre / Folke - Score: 50 - 11/24/11 @ 21:37
<Down>V:s/Subtracts "x" from "y"/Adds "a" to "b"/<CR>:wqa<CR>

0 comments


#459 tinco / tinco - Score: 52 - 12/29/10 @ 15:26
j:s/Subtracts/Adds<CR>V:s/from/to<CR>:s/x/a<CR>:s/y/b<CR>:wq<CR>

0 comments


#460 jonbell17 / jonbell17 - Score: 54 - 12/30/10 @ 19:49
<Down>:s/Subtracts/Adds<CR>:s/from/to<CR>:s/x/a/<BS><CR>:s/y/b<CR>:wq<CR>

0 comments


#461 Levon Lloyd / levonlloyd - Score: 56 - 02/04/11 @ 16:08
:%s/Subtract/Add/<CR>:.s/from/to/<CR>:s/x/a/<CR>:s/<BS><BS>.s/y <BS>/b/<CR>ZZ

0 comments


#462 kaipi / kaipi - Score: 58 - 12/29/10 @ 19:16
:%s/Subtracts \"x\" from \"y\"/Adds \"a\" to \"b\"<CR>:wq<CR>

0 comments


#463 Mike Adolphs / mike_adolphs - Score: 60 - 12/28/10 @ 23:30
:2s#""" Subtracts "x" from "y"#""" Adds "a" to "b"#g<CR>:wq<CR>

0 comments


#464 Frank Hui / frankhui - Score: 69 - 12/29/10 @ 06:44
:1,$ s/Subtracts/Adds/<CR>:1,$ s/x/a/<CR>:1,$ s/from/to/<CR>:1,$ s/y/b/<CR>:w<CR>:q<CR>

0 comments


Created by: wolever

464 active golfers, 1191 entries

Leaderboard (lowest score wins):
22
#1 - Aaron Bull Schaefer / elasticdog

12/28/2010 at 11:43PM

22
#2 - togi / togi

12/29/2010 at 05:08PM

22
#3 - Austin Taylor / austintaylor

12/29/2010 at 05:13PM

22
#4 - Utkarsh Kukreti / utkarshkukreti

12/29/2010 at 05:41PM

22
#5 - dcbaok / dcbaok

12/29/2010 at 08:55PM

22
#6 - Mike Plotz / antisuji

12/30/2010 at 01:42AM

22
#7 - Josh Weinberg / jcweinberg

12/30/2010 at 04:31AM

22
#8 - Akira Matsuda / a_matsuda

12/30/2010 at 05:27AM

22
#9 - h_east (トロッコ6個) / h_east

12/30/2010 at 09:18AM

22
#10 - Ben Lenarts / benlenarts

12/30/2010 at 11:35AM

22
#11 - Mikel Ward / mikelward

12/31/2010 at 06:53AM

22
#12 - Dmytro Shteflyuk / kpumuk

12/31/2010 at 07:39AM

22
#13 - Guillaume Bonnoron / gbonnoron

12/31/2010 at 12:41PM

22
#14 - Behnam Esfahbod / zwnj

12/31/2010 at 02:21PM

22
#15 - Casey W Crites / caseycrites

12/31/2010 at 10:01PM

22
#16 - dominique pellé / vimgolfisto

01/01/2011 at 01:20PM

22
#17 - n / kivran

01/01/2011 at 06:06PM

22
#18 - Balkoth / _Balkoth_

01/01/2011 at 06:51PM

22
#19 - Brad / bjjwillis

01/02/2011 at 11:37AM

22
#20 - Asmund / herrasbe

01/02/2011 at 06:21PM

22
#21 - Wei Dai / clvv42

01/02/2011 at 11:49PM

22
#22 - Larry Marburger / lmarburger

01/03/2011 at 05:58PM

22
#23 - ls lahrs / lslah

01/04/2011 at 08:16PM

22
#24 - Ravil Bayramgalin / brainopia

01/05/2011 at 02:36AM

22
#25 - derp derp / derp__

01/05/2011 at 06:23AM

22
#26 - Fer Enaf / 0x00C0FFEE

01/05/2011 at 10:52AM

22
#27 - Ujjwol Lamichhane / Ujjwol

01/06/2011 at 11:49AM

22
#28 - Tim Chase / gumnos

01/08/2011 at 04:11AM

22
#29 - Pete Johns / johnsyweb

01/09/2011 at 09:09AM

22
#30 - Matt Tarbit / mtarbit

01/09/2011 at 09:21AM