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 @winter-loo:

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

262 active golfers, 1073 entries

Solutions by @winter-loo:
19
#56 - winter-loo / @winter-loo

10/07/2026 at 08:27AM

20
#>78 - winter-loo / @winter-loo

10/07/2026 at 06:31AM

21
#>92 - winter-loo / @winter-loo

10/07/2026 at 06:31AM

22
#>99 - winter-loo / @winter-loo

10/07/2026 at 06:30AM

23
#>102 - winter-loo / @winter-loo

10/07/2026 at 06:30AM

24
#>112 - winter-loo / @winter-loo

10/07/2026 at 06:29AM

25
#>128 - winter-loo / @winter-loo

10/07/2026 at 06:29AM

26
#>138 - winter-loo / @winter-loo

10/07/2026 at 06:29AM

27
#>145 - winter-loo / @winter-loo

10/07/2026 at 06:28AM

28
#>154 - winter-loo / @winter-loo

10/07/2026 at 06:28AM

29
#>165 - winter-loo / @winter-loo

10/07/2026 at 06:28AM

30
#>173 - winter-loo / @winter-loo

10/07/2026 at 06:27AM

31
#>183 - winter-loo / @winter-loo

10/07/2026 at 06:27AM

48
#>248 - winter-loo / @winter-loo

10/07/2026 at 06:20AM

50
#>250 - winter-loo / @winter-loo

10/07/2026 at 03:58AM