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

609 active golfers, 1649 entries

Leaderboard (lowest score wins):
29
#541 - akashcapitalnumbers / @akashcapitalnumbers

12/26/2024 at 08:11PM

29
#542 - Adrian Lym / @AJGamma

05/14/2025 at 01:47PM

30
#543 - Ronuk Raval / @rraval

12/28/2010 at 11:29PM

30
#544 - Stefan Borsje / @sborsje

12/28/2010 at 11:53PM

30
#545 - Phil / @phil30075

12/29/2010 at 04:18AM

30
#546 - pcapriotti / @pcapriotti

12/29/2010 at 11:47AM

30
#547 - Daniel Hahler / @blueyed

12/29/2010 at 07:23PM

30
#548 - Amir Hedayaty / @hedayaty

12/30/2010 at 12:33PM

30
#549 - Tim Andersson / @Boerworz

04/19/2011 at 09:44PM

30
#550 - Scott Myц / @ScottMuc

04/07/2013 at 05:01AM

30
#551 - Justin Knag / @justinknag

08/28/2014 at 02:53PM

30
#552 - Jurica / @Jurica34581259

11/16/2018 at 05:33PM

30
#553 - abhijeet patil / @abhijeetptl5

09/03/2020 at 03:12AM

30
#554 - Matthew Beaumont / @mattybeau_dev

11/26/2021 at 05:19PM

30
#555 - anonymouse / @anonymo65837183

03/27/2022 at 11:10PM

30
#556 - Alexis Jimenez / @mickambar19

04/29/2024 at 08:57PM

31
#557 - David Wolever / @wolever

12/28/2010 at 11:27PM

31
#558 - Paul Tarjan / @ptarjan

12/29/2010 at 11:35AM

31
#559 - leprechaun / @irishlinuxgeek

12/29/2010 at 06:57PM

31
#560 - garygordon / @garygordon

01/01/2011 at 07:25PM

31
#561 - rdt / @rdtft

02/07/2011 at 11:16PM

31
#562 - Alex Kolesnikov / @k0lesman

05/01/2011 at 12:31AM

31
#563 - Bjørn Einar Bjartnes / @bjartnes

01/27/2012 at 01:44PM

31
#564 - Aaron / @_Lordofthevoid_

12/10/2019 at 08:43PM

31
#565 - Olivier Bégassat / @zk_evm

05/27/2023 at 05:04PM

31
#566 - xiaoao1024 / @xiaoao1024

12/22/2023 at 10:46AM

32
#567 - Joe McCall / @joem86

12/29/2010 at 01:09AM

32
#568 - Peter Krenn / @peterkrenn

12/29/2010 at 01:24AM

32
#569 - Tyler Wymer / @twymer

12/29/2010 at 02:27AM

32
#570 - Chris Metcalf / @chrismetcalf

12/29/2010 at 04:32AM