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 5f23f29e1e8861000c3105c5

Python: Def to Lambda

LAMBDA!!!

Start file
def f(x): return x ** 2
End file
f = lambda x: x ** 2

View Diff

1c1
< def f(x): return x ** 2
---
> f = lambda x: x ** 2

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 154 remaining solutions by signing in and submitting your own entry
#155 Tony Buranzon / @therealTbunz - Score: 32 - 03/19/21 @ 06:29
dtfli =<Esc>llctxlambda x: <Esc>lldfx<Esc>ZZ

0 comments


#156 Derya / @dbmeral - Score: 32 - 04/02/22 @ 12:13
dexldexr=i <Esc>llldeilambda x:<Esc>:wq<CR>

0 comments


Created by: @_rustemb

156 active golfers, 455 entries

Leaderboard (lowest score wins):
20
#91 - Alex Harston / @alexharston

08/01/2020 at 11:04PM

20
#92 - Jason Zhang / @jiamingz721

08/02/2020 at 04:14AM

20
#93 - Maibritt Illner / @Maibritt_Illner

08/04/2020 at 06:34PM

20
#94 - Dionysus / @user101user

08/04/2020 at 09:41PM

20
#95 - Kenny Nguyen / @KennyNg72375669

08/05/2020 at 06:17PM

20
#96 - Golf Gopher / @GolfGopher3

08/17/2020 at 08:29PM

20
#97 - Borna Sadeghi / @borna_sadeghi

03/19/2021 at 07:23PM

20
#98 - warwickrulez / @warwickrulez

04/04/2021 at 06:07PM

20
#99 - tarsiec / @tarsiec

07/12/2021 at 10:59AM

20
#100 - mevmev / @mevmev8

09/09/2021 at 01:49PM

20
#101 - vimbroesel / @vimbroesel

01/23/2022 at 12:08PM

20
#102 - Даня Ефимов / @Abberatus

02/19/2022 at 03:35PM

20
#103 - nd183 / @nd1832

03/07/2022 at 02:12PM

20
#104 - math is what I hate / @mpnmbn

03/13/2022 at 02:47PM

20
#105 - タケ / @Take3832

05/13/2022 at 03:24AM

20
#106 - bitquence / @_bitquence

06/04/2022 at 11:56PM

21
#107 - Martin Bielik / @mabielik

08/06/2020 at 09:26PM

21
#108 - Zach Kirby / @zkirby2020

08/20/2020 at 05:38AM

21
#109 - Pepe / @PedroVassena

09/08/2020 at 07:50AM

21
#110 - Brendan Schaenzer / @bschaenzer

09/30/2020 at 02:25PM

21
#111 - Captain Proton / @CaptainProton5

09/03/2021 at 09:53PM

21
#112 - chaotic / @laersn

11/04/2021 at 10:52AM

21
#113 - good enough ; 🌿 / @daisyymint

03/03/2022 at 01:38PM

21
#114 - Gunter Kluge / @KlugeGunter

04/06/2022 at 06:37PM

21
#115 - Irakli Chigvaria / @tchigvaria

05/23/2022 at 06:16PM

22
#116 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 06:23PM

22
#117 - Selvaganapathy P / @canabady

02/20/2021 at 09:49AM

22
#118 - aravindthangavel / @aravindpt

04/15/2022 at 04:13PM

22
#119 - Brandon / @Brandon10678836

08/25/2022 at 11:18AM

22
#120 - Vinay Sridhar / @kewllip

03/31/2023 at 03:49PM