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 9v0069dd19600000000007c9

Swap function parameters and delete all comments in python.

Swap function parameters and delete all comments in python.

Start file
# caculate area
def calculate_area(width, height): # width, height
    return width * height # return area

area1 = calculate_area(5, 10)
area2 = calculate_area(8, 12)
End file
def calculate_area(height, width):
    return width * height

area1 = calculate_area(5, 10)
area2 = calculate_area(8, 12)

View Diff

1,3c1,2
< # caculate area
< def calculate_area(width, height): # width, height
<     return width * height # return area
---
> def calculate_area(height, width):
>     return width * height

Solutions by @petr-kx:

Unlock 8 remaining solutions by signing in and submitting your own entry
Created by: @skywalkerwhack

262 active golfers, 1073 entries

Solutions by @petr-kx:
19
#55 - petr-kx / @petr-kx

10/05/2026 at 09:34AM

21
#>92 - petr-kx / @petr-kx

10/05/2026 at 09:30AM

22
#>99 - petr-kx / @petr-kx

10/02/2026 at 12:11PM

23
#>102 - petr-kx / @petr-kx

10/02/2026 at 12:00PM

24
#>112 - petr-kx / @petr-kx

10/02/2026 at 11:55AM

25
#>128 - petr-kx / @petr-kx

09/30/2026 at 11:54AM

29
#>165 - petr-kx / @petr-kx

09/30/2026 at 11:53AM

30
#>173 - petr-kx / @petr-kx

09/30/2026 at 08:21AM