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 46 remaining solutions by signing in and submitting your own entry
#47 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

47 active golfers, 172 entries

Leaderboard (lowest score wins):
52
#31 - Eric Söderström / @eksoderstrom

03/18/2021 at 02:40PM

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

02/03/2021 at 01:54PM

54
#33 - syuusaku / @GSyuusaku

02/20/2021 at 11:31AM

54
#34 - huscarl / @huscarl6

05/20/2021 at 04:38AM

58
#35 - simplelife2010 / @simplelife20101

05/13/2021 at 12:26PM

59
#36 - Dmitry Antonyuk / @AntonyukDmitry

08/24/2021 at 05:14PM

60
#37 - e1mnos / @e1mnos

08/12/2021 at 01:57PM

61
#38 - Ethan Rietz / @EthanRietz

07/23/2021 at 07:56PM

62
#39 - ever0de / @ever0de

06/04/2021 at 01:52AM

64
#40 - Jemma / @Fwippy

06/28/2021 at 06:06PM

66
#41 - Ventura / @vetu11

05/12/2021 at 03:40PM

66
#42 - 44 / @e__oioi

05/22/2021 at 12:40PM

66
#43 - François / @mortyZZ

07/26/2021 at 07:23PM

69
#44 - Marcus / @marcusostling94

06/10/2021 at 07:56PM

81
#45 - fff / @fff51460170

02/20/2021 at 03:33PM

91
#46 - :wq / @write_quit_22

05/18/2021 at 05:14PM

93
#47 - Un Extraño / @link145m

07/30/2021 at 02:52PM