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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 70 remaining solutions by signing in and submitting your own entry
#71 Emek Cohen / @EmekC - Score: 49 - 04/25/26 @ 14:16
ddfwvecheight<Esc>wwvecwidth<Esc>wllv$hx<Esc>jbbhv$xa<CR><Esc>kj:wq<CR>

0 comments


Created by: @skywalkerwhack

71 active golfers, 264 entries

Leaderboard (lowest score wins):
19
#1 - “Smylers” / @Smylers2

04/15/2026 at 05:51AM

19
#2 - Petro Тrouq / @zulolosi

04/15/2026 at 06:29AM

19
#3 - Massimo Pavoni / @massimopavoni

04/15/2026 at 09:41PM

19
#4 - Adrian / @adrianlgtm

04/19/2026 at 01:35PM

19
#5 - Andrew / @fr0streaper

04/20/2026 at 08:21AM

19
#6 - aurevelle / @aurevelle

04/23/2026 at 09:57PM

19
#7 - Dmytro Khomutnyk / @XoMute

04/25/2026 at 10:40AM

19
#8 - Jacob Demory / @JacobDemory

04/26/2026 at 10:12PM

19
#9 - Jess Price / @JRPrice5

04/27/2026 at 01:11PM

19
#10 - Liimurr / @Liimurr

04/29/2026 at 02:52PM

19
#11 - Johnny / @Jphamster101

04/30/2026 at 07:39PM

19
#12 - 000AG000 / @000AG000

05/04/2026 at 08:14PM

19
#13 - buenos / @buenos-dan

05/05/2026 at 05:20AM

19
#14 - Katie Gardner / @KatieLG

05/05/2026 at 07:59AM

19
#15 - Silver / @paradisehex

05/11/2026 at 10:01PM

19
#16 - Arseniy Lyskov / @ArseniyLyskov

05/12/2026 at 09:02PM

20
#17 - ZEraX4 / @ZEraX4

04/13/2026 at 07:00PM

20
#18 - skywalkerwhack / @skywalkerwhack

04/16/2026 at 07:28AM

20
#19 - Nıklas Rıeken / @ttnick

04/16/2026 at 08:07AM

20
#20 - kody-codes / @kody-codes

04/16/2026 at 06:34PM

20
#21 - mtiennguyen / @mtiennguyen

05/11/2026 at 12:54PM

20
#22 - ctrlXctrlV / @ctrlXctrlV

05/13/2026 at 05:49AM

20
#23 - WillemvanLoenen / @WillemvanLoenen

05/13/2026 at 12:00PM

20
#24 - Шамиль Рахимов / @shhhhammm

05/15/2026 at 06:59AM

21
#25 - Daniil Tkachenko / @deadpadre

04/18/2026 at 10:57PM

21
#26 - yyykt / @yyykt

04/20/2026 at 03:05PM

21
#27 - michaelgattas / @michaelgattas

05/04/2026 at 08:16PM

23
#28 - lemonish / @p-lemonish

04/19/2026 at 05:57PM

24
#29 - Rafe Murray / @rafe-murray

04/21/2026 at 12:10AM

24
#30 - Baptiste Nicolet / @bathal1

04/23/2026 at 01:17PM