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

635 active golfers, 1736 entries

Leaderboard (lowest score wins):
23
#331 - Lory / @Lory46845742

11/20/2019 at 12:57PM

23
#332 - iBhagwan / @iiBhagwan

06/04/2020 at 05:12PM

23
#333 - Michel Viktor / @tomkpz

08/11/2021 at 07:45PM

23
#334 - Dmitry / @MsDosLite

08/16/2021 at 02:39PM

23
#335 - Sean Cahill / @ess_jay_kay

11/01/2021 at 03:40PM

23
#336 - POSIX / @po6ix

01/10/2022 at 01:33AM

23
#337 - shahanavaz m / @shahanavazm

02/12/2022 at 10:38PM

23
#338 - blabla zincou / @BZincou

03/09/2022 at 08:02PM

23
#339 - x03n046 / @x03n046

05/13/2022 at 05:18AM

23
#340 - Brandon / @Brandon10678836

08/31/2022 at 11:47PM

23
#341 - jimmarq / @jimmarq

11/01/2022 at 07:00PM

23
#342 - Geek Boy / @Geek79

11/08/2022 at 10:18PM

23
#343 - Qishuai Liu / @LiuQishuai

01/10/2023 at 01:14PM

23
#344 - Berkay Berabi / @BerkayBerabi

05/01/2023 at 05:17PM

23
#345 - Pablo Acuna / @pacuna

10/24/2024 at 12:18AM

23
#346 - bounce114 / @bounce114

12/02/2024 at 02:35AM

23
#347 - Anton Savelyev / @PoiXP

01/03/2025 at 11:00PM

23
#348 - Sergii Pidgornyi / @spodgorn

02/14/2025 at 12:31AM

23
#349 - Nalfein (Kenny) / @Nalfein16

05/15/2025 at 07:35PM

23
#350 - thomasyang18 / @thomasyang18

05/17/2025 at 12:35AM

23
#351 - Graham Pye / @Fraham

05/20/2025 at 10:04PM

23
#352 - ffseq / @ffseq

06/23/2025 at 03:23AM

23
#353 - Will Powers / @wpowers42

08/04/2025 at 02:26PM

23
#354 - Davidoof / @davidoof3141

08/16/2025 at 03:21PM

23
#355 - tphLatte / @tphLatte

10/19/2025 at 12:56AM

24
#356 - Samus_ Michael / @gonna_hate

12/29/2010 at 04:59AM

24
#357 - uuu / @uu59

12/29/2010 at 11:54PM

24
#358 - Cristi Balan / @evilchelu

01/01/2011 at 06:42AM

24
#359 - vTsoumenis / @kioopi

01/02/2011 at 05:48PM

24
#360 - Nick / @quinks25

01/10/2011 at 04:41AM