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 @jstramer:

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

228 active golfers, 923 entries

Solutions by @jstramer:
20
#62 - Jorrit Stramer / @jstramer

05/25/2026 at 05:36AM

21
#>71 - Jorrit Stramer / @jstramer

05/25/2026 at 05:34AM

22
#>78 - Jorrit Stramer / @jstramer

05/25/2026 at 05:33AM

23
#>83 - Jorrit Stramer / @jstramer

05/25/2026 at 05:30AM

24
#>91 - Jorrit Stramer / @jstramer

05/25/2026 at 05:26AM

26
#>114 - Jorrit Stramer / @jstramer

05/25/2026 at 05:21AM

27
#>117 - Jorrit Stramer / @jstramer

05/25/2026 at 05:03AM

36
#>192 - Jorrit Stramer / @jstramer

05/25/2026 at 04:58AM