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 491 remaining solutions by signing in and submitting your own entry
#492 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

492 active golfers, 1267 entries

Leaderboard (lowest score wins):
25
#301 - Lieven Keersmaekers / @LievenKeersmaek

01/18/2013 at 06:43PM

25
#302 - Joshua Draper / @JoshuaBDraper

05/25/2013 at 03:50PM

25
#303 - Todd Branchflower / @toddbranch

07/18/2013 at 09:13PM

25
#304 - Nathan / @NathanHarperoni

08/08/2013 at 01:30PM

25
#305 - Bart of Denver / @bartofdenver

08/12/2013 at 04:30PM

25
#306 - Salleyron Julien / @juguul

01/02/2014 at 10:28AM

25
#307 - ryk / @rykarn

05/02/2014 at 08:02PM

25
#308 - Amir Kremer / @AmirKremer

07/27/2014 at 02:06PM

25
#309 - Vincent Dumoulin / @dumoulinv

11/23/2014 at 05:28AM

25
#310 - Zach Gulde / @zgulde

02/29/2016 at 06:00AM

25
#311 - Paul Draghicescu / @pdragy

03/23/2018 at 12:04AM

25
#312 - faisal / @faisalhackshah

11/26/2018 at 07:12PM

25
#313 - Ivo Blöchliger / @aigledesalpes

08/18/2019 at 08:10AM

26
#314 - Duda Dornelles / @dudadornelles

12/29/2010 at 12:06AM

26
#315 - Todd Dombrowski / @tdombrowski

12/29/2010 at 12:07AM

26
#316 - Steven Grady / @steven807

12/29/2010 at 01:07AM

26
#317 - omelo / @omelo

12/29/2010 at 08:46AM

26
#318 - Leonard Chin / @lchin

12/29/2010 at 10:42AM

26
#319 - Indrek Juhkam / @indrekj

12/29/2010 at 11:52AM

26
#320 - Adam Pohorecki / @apohorecki

12/29/2010 at 02:16PM

26
#321 -  Ikhsan Maulana / @ixandidu

12/30/2010 at 11:03AM

26
#322 - Denis Odorcic / @denisodorcic

12/30/2010 at 08:25PM

26
#323 - Jim Garvin / @coderifous

12/30/2010 at 09:10PM

26
#324 - Sam Nardoni / @samnardoni

12/31/2010 at 12:26AM

26
#325 - clint tseng / @cxlt

01/02/2011 at 06:39AM

26
#326 - Stuart Gale / @bishboria

01/02/2011 at 04:54PM

26
#327 - bing_twic / @bing_twic

03/09/2011 at 07:33PM

26
#328 - Craig H. Anderson / @CootCraig

04/19/2011 at 09:06PM

26
#329 - Jean-Christophe Cyr / @jccyr01

05/28/2011 at 02:00AM

26
#330 - Rolf K. / @mindleftbody

06/17/2011 at 12:59PM