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

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

228 active golfers, 923 entries

Solutions by @JCapretta:
19
#43 - JCapretta / @JCapretta

07/31/2026 at 10:39AM

19
#>43 - JCapretta / @JCapretta

07/31/2026 at 10:50AM

20
#>68 - JCapretta / @JCapretta

07/31/2026 at 10:38AM

21
#>78 - JCapretta / @JCapretta

07/31/2026 at 10:34AM

22
#>82 - JCapretta / @JCapretta

07/31/2026 at 10:28AM

23
#>84 - JCapretta / @JCapretta

07/31/2026 at 10:26AM

24
#>94 - JCapretta / @JCapretta

07/31/2026 at 10:25AM

25
#>106 - JCapretta / @JCapretta

07/31/2026 at 10:22AM

28
#>131 - JCapretta / @JCapretta

07/31/2026 at 10:18AM

30
#>146 - JCapretta / @JCapretta

07/31/2026 at 10:10AM