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 6019f1c4642668000cee11e8

Generate a very basic Python constructor

I actually needed to do this myself, so I look forward to learning how.

Start file
def __init__(self, x, y, z, rotation, color, bounciness, walking_speed, running_speed, health, defense, age, type1, type2):
End file
def __init__(self, x, y, z, rotation, color, bounciness, walking_speed, running_speed, health, defense, age, type1, type2):
    self.x = x
    self.y = y
    self.z = z
    self.rotation = rotation
    self.color = color
    self.bounciness = bounciness
    self.walking_speed = walking_speed 
    self.running_speed = running_speed
    self.health = health
    self.defense = defense
    self.age = age 
    self.type1 = type1
    self.type2 = type2

View Diff

1a2,14
>     self.x = x
>     self.y = y
>     self.z = z
>     self.rotation = rotation
>     self.color = color
>     self.bounciness = bounciness
>     self.walking_speed = walking_speed 
>     self.running_speed = running_speed
>     self.health = health
>     self.defense = defense
>     self.age = age 
>     self.type1 = type1
>     self.type2 = type2

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 42 remaining solutions by signing in and submitting your own entry
#43 Un Extraño / @link145m - Score: 93 - 07/30/21 @ 14:52
f2v13Byo<BS><CR><BS><Esc>pkpVj:s/, /\r/g<CR>12k:,$g/./2m-1|j<CR>V12k:s/ / = /g<CR><C-V>12kI    self.<Esc>11jk$i<Right> <Esc>4k$i<Right> <Esc>ZZ

0 comments


Created by: @BiddulphCaleb

43 active golfers, 167 entries

Leaderboard (lowest score wins):
30
#1 - Andreas Siegrist / @andreaszwei

06/16/2021 at 03:47PM

38
#2 - Jon Krause / @jkrause314

02/04/2021 at 08:18PM

38
#3 - A A A / @37fatos

02/04/2021 at 08:40PM

38
#4 - John Braxler / @braxler

02/05/2021 at 03:54PM

38
#5 - Duncan / @Duncan31503119

02/07/2021 at 03:19AM

38
#6 - hamb / @hamb88140219

02/25/2021 at 08:11PM

38
#7 - der tanzbaer / @der_tanzbaer

03/10/2021 at 10:47PM

38
#8 - Ray Dennis / @raysden

05/19/2021 at 01:18PM

38
#9 - Arya Kumar / @SusSquirrel

05/22/2021 at 07:52PM

38
#10 - Kyle / @Kyle98675198

05/30/2021 at 12:12AM

38
#11 - Miłosz Łakomy / @foobar01123

06/20/2021 at 10:05AM

38
#12 - Georg Bökman / @BokmanGeorg

07/03/2021 at 12:02AM

38
#13 - sap / @sap38838304

07/03/2021 at 04:51AM

38
#14 - 悟史 / @A1OBJTxN5fTg5EJ

07/12/2021 at 04:48PM

38
#15 - ゆに / @lededex

07/13/2021 at 07:36PM

39
#16 - roudens / @roudens2

05/22/2021 at 02:02PM

43
#17 - Calarasanu Andrei / @_fanfani4_

05/18/2021 at 07:43PM

43
#18 - Youngchan Lee / @edwardycl

06/03/2021 at 05:16AM

44
#19 - AAbraxas / @AAbraxas1

02/04/2021 at 08:36PM

45
#20 - Blake Tereau / @BlakeTereau

02/07/2021 at 11:35PM

45
#21 - Martin LOUAZEL / @Zbrahark

02/24/2021 at 08:30AM

45
#22 - Winnie Yeung / @vionwinnie

07/02/2021 at 01:27AM

46
#23 - Chris Conte / @chriscconte

02/11/2021 at 02:04AM

46
#24 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 06:09PM

47
#25 - Smylers / @Smylers2

02/04/2021 at 09:33AM

48
#26 - Paul Inc / @hiniol1982

02/05/2021 at 07:42PM

49
#27 - grsh / @girish_i_am

05/23/2021 at 12:00PM

50
#28 - Daniel Qu / @danielq9871

05/10/2021 at 04:47PM

52
#29 - Eric Söderström / @eksoderstrom

03/18/2021 at 02:40PM

54
#30 - Jonáš Šerých / @serycjon

02/03/2021 at 01:54PM