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 @Michael-Shaffer:

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

206 active golfers, 796 entries

Solutions by @Michael-Shaffer:
19
#35 - Michael Shaffer / @Michael-Shaffer

07/05/2026 at 12:50AM

21
#>68 - Michael Shaffer / @Michael-Shaffer

07/05/2026 at 12:30AM

22
#>73 - Michael Shaffer / @Michael-Shaffer

07/05/2026 at 12:23AM

23
#>75 - Michael Shaffer / @Michael-Shaffer

07/05/2026 at 12:16AM

24
#>83 - Michael Shaffer / @Michael-Shaffer

07/05/2026 at 12:06AM

25
#>95 - Michael Shaffer / @Michael-Shaffer

07/04/2026 at 11:50PM

32
#>146 - Michael Shaffer / @Michael-Shaffer

07/04/2026 at 11:18PM

33
#>153 - Michael Shaffer / @Michael-Shaffer

07/04/2026 at 11:18PM

36
#>176 - Michael Shaffer / @Michael-Shaffer

07/04/2026 at 11:12PM

41
#>187 - Michael Shaffer / @Michael-Shaffer

07/04/2026 at 08:56PM

58
#>199 - Michael Shaffer / @Michael-Shaffer

07/04/2026 at 08:53PM