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

577 active golfers, 1541 entries

Leaderboard (lowest score wins):
25
#361 - Nathan / @NathanHarperoni

08/08/2013 at 01:30PM

25
#362 - Bart of Denver / @bartofdenver

08/12/2013 at 04:30PM

25
#363 - Salleyron Julien / @juguul

01/02/2014 at 10:28AM

25
#364 - ryk / @rykarn

05/02/2014 at 08:02PM

25
#365 - Amir Kremer / @AmirKremer

07/27/2014 at 02:06PM

25
#366 - Vincent Dumoulin / @dumoulinv

11/23/2014 at 05:28AM

25
#367 - Zach Gulde / @zgulde

02/29/2016 at 06:00AM

25
#368 - Paul Draghicescu / @pdragy

03/23/2018 at 12:04AM

25
#369 - faisal / @faisalhackshah

11/26/2018 at 07:12PM

25
#370 - Ivo Blöchliger / @aigledesalpes

08/18/2019 at 08:10AM

25
#371 - Michael / @openemitter

12/27/2023 at 01:41PM

26
#372 - Duda Dornelles / @dudadornelles

12/29/2010 at 12:06AM

26
#373 - Todd Dombrowski / @tdombrowski

12/29/2010 at 12:07AM

26
#374 - Steven Grady / @steven807

12/29/2010 at 01:07AM

26
#375 - omelo / @omelo

12/29/2010 at 08:46AM

26
#376 - Leonard Chin / @lchin

12/29/2010 at 10:42AM

26
#377 - Indrek Juhkam / @indrekj

12/29/2010 at 11:52AM

26
#378 - Adam Pohorecki / @apohorecki

12/29/2010 at 02:16PM

26
#379 -  Ikhsan Maulana / @ixandidu

12/30/2010 at 11:03AM

26
#380 - Denis Odorcic / @denisodorcic

12/30/2010 at 08:25PM

26
#381 - Jim Garvin / @coderifous

12/30/2010 at 09:10PM

26
#382 - Sam Nardoni / @samnardoni

12/31/2010 at 12:26AM

26
#383 - clint tseng / @cxlt

01/02/2011 at 06:39AM

26
#384 - Stuart Gale / @bishboria

01/02/2011 at 04:54PM

26
#385 - bing_twic / @bing_twic

03/09/2011 at 07:33PM

26
#386 - Craig H. Anderson / @CootCraig

04/19/2011 at 09:06PM

26
#387 - Jean-Christophe Cyr / @jccyr01

05/28/2011 at 02:00AM

26
#388 - Rolf K. / @mindleftbody

06/17/2011 at 12:59PM

26
#389 - Jim Infield / @jinfield

07/15/2011 at 12:01AM

26
#390 - quintin / @quintinjeannoel

08/29/2011 at 09:13PM