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

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

263 active golfers, 1078 entries

Solutions by @sammcentee:
19
#57 - Sam McEntee / @sammcentee

10/18/2026 at 08:11PM

19
#>57 - Sam McEntee / @sammcentee

10/18/2026 at 08:16PM

20
#>80 - Sam McEntee / @sammcentee

10/18/2026 at 08:09PM

21
#>93 - Sam McEntee / @sammcentee

10/18/2026 at 08:08PM

22
#>100 - Sam McEntee / @sammcentee

10/18/2026 at 08:06PM

23
#>103 - Sam McEntee / @sammcentee

10/18/2026 at 08:05PM

24
#>113 - Sam McEntee / @sammcentee

10/18/2026 at 08:05PM

25
#>129 - Sam McEntee / @sammcentee

10/18/2026 at 08:03PM

28
#>155 - Sam McEntee / @sammcentee

10/18/2026 at 08:01PM

30
#>175 - Sam McEntee / @sammcentee

10/18/2026 at 08:00PM

31
#>185 - Sam McEntee / @sammcentee

10/18/2026 at 07:59PM

34
#>214 - Sam McEntee / @sammcentee

10/18/2026 at 07:57PM

37
#>232 - Sam McEntee / @sammcentee

10/18/2026 at 07:55PM

39
#>238 - Sam McEntee / @sammcentee

10/18/2026 at 07:54PM

56
#>253 - Sam McEntee / @sammcentee

10/18/2026 at 07:51PM