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

607 active golfers, 1646 entries

Leaderboard (lowest score wins):
27
#511 - Luis Fernando Rodríguez Vargas / @LuisFerRodVar

06/25/2024 at 07:52PM

28
#512 - lionel young / @lionelyoung

12/28/2010 at 11:42PM

28
#513 - eolo999 / @eolo999

12/29/2010 at 12:04AM

28
#514 - Martin Pugh / @s3krit

12/29/2010 at 02:11AM

28
#515 - Hung Huu Hoang / @hungh3

12/30/2010 at 07:36AM

28
#516 - Jan B. / @bracki

01/03/2011 at 10:27PM

28
#517 - Wesley Wong / @wesleymwwong

01/29/2011 at 09:59PM

28
#518 - Sergey Kim / @skim1776

08/22/2011 at 09:00AM

28
#519 - ise0615 / @ise0615

05/04/2012 at 05:23PM

28
#520 - curist / @curist

07/09/2013 at 08:06AM

28
#521 - Oliver Christ / @0liverChrist

09/25/2013 at 03:19PM

28
#522 - Bjorn / @bjorn_248

11/15/2013 at 09:01PM

28
#523 - z0c / @zerocabal

06/12/2018 at 08:58AM

28
#524 - Christophe LE ROY / @Nestorfish44

04/29/2022 at 07:28PM

29
#525 - Jason Gilman / @axodys

12/29/2010 at 12:43AM

29
#526 - Simon Brown / @caelyxsec

12/29/2010 at 06:49AM

29
#527 - Joe Hassick / @jhassick

12/29/2010 at 05:41PM

29
#528 - TchiKong / @tchikong

01/23/2011 at 11:22AM

29
#529 - Ed Gibbs / @edward_gibbs

08/18/2011 at 02:46AM

29
#530 - Dave Lyon / @daveisonthego

09/16/2011 at 01:07AM

29
#531 - Daniel Harrington / @rubiii

12/10/2011 at 07:46PM

29
#532 - Nick Bakkegaard / @Bakkemand

11/26/2012 at 11:59PM

29
#533 - Chenut Ludovic / @7Brwa7

03/31/2016 at 04:43PM

29
#534 - Max Del Giudice / @max_forest

04/18/2016 at 08:51AM

29
#535 - Paul Molloy / @paulsmolloy

04/04/2024 at 07:03PM

29
#536 - Yash Kulshrestha / @YashdalfTheGray

04/13/2024 at 06:10PM

29
#537 - dennis / @nagolove

04/22/2024 at 02:23PM

29
#538 - KhaAdam / @KhaAdam

08/09/2024 at 11:29AM

29
#539 - akashcapitalnumbers / @akashcapitalnumbers

12/26/2024 at 08:11PM

29
#540 - Adrian Lym / @AJGamma

05/14/2025 at 01:47PM