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 @buenos-dan:

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

94 active golfers, 335 entries

Solutions by @buenos-dan:
19
#13 - buenos / @buenos-dan

05/05/2026 at 05:20AM

20
#>22 - buenos / @buenos-dan

05/05/2026 at 05:18AM

21
#>32 - buenos / @buenos-dan

05/05/2026 at 05:17AM

22
#>32 - buenos / @buenos-dan

05/05/2026 at 05:08AM

24
#>39 - buenos / @buenos-dan

05/05/2026 at 05:07AM

25
#>40 - buenos / @buenos-dan

05/05/2026 at 05:03AM

37
#>85 - buenos / @buenos-dan

05/05/2026 at 04:59AM