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 95 remaining solutions by signing in and submitting your own entry
#96 วทททท / @uhTOWreLzQy0JN5 - Score: 351 - 03/02/22 @ 14:18
o<BS>    self.<Esc>yy12p<CR>$<Up><Up>i<Right>x = x<Down>y = y<Down>z = z<Down>rotation<Esc>yiw$i <BS><Right> = <Esc>p<Down>i<Right>color = oo<BS><BS>color<Down>bounciness<Esc>yiw$i<Right> = <Esc>p<Down>i<Right>walking_speed <BS><Esc>yiw$i<Right> = <Esc>p<Down>i<Right>running_speed <BS> = <BS><BS><BS><Esc>yiw$i =<BS><BS><Right> =<Esc>i<Right> <Esc>pi<Up><Right> <Down><Down>health<Esc>yiw$i<Right> = <Esc>p<Down>i<Right>defenc<BS>se<Esc>yiw$i<Right> = `<Esc>pbi<BS><Down>age=<BS> = age <Down>type1 = type1<Down>type2 = type2<Esc>cccccbbjeuetgrgluehidbfnutdfujvcfnilfnubhigb<CR>dd<BS><BS><Esc>ddddoself.type2 = type2<Esc>:wq<CR>

0 comments


Created by: @BiddulphCaleb

96 active golfers, 314 entries

Leaderboard (lowest score wins):
44
#31 - AAbraxas / @AAbraxas1

02/04/2021 at 08:36PM

44
#32 - Andreas Siegrist / @andreaszwei

06/16/2021 at 03:17PM

45
#33 - Blake Tereau / @BlakeTereau

02/07/2021 at 11:35PM

45
#34 - Martin LOUAZEL / @Zbrahark

02/24/2021 at 08:30AM

45
#35 - Winnie Yeung / @vionwinnie

07/02/2021 at 01:27AM

45
#36 - Hossein Yousefi 💙 / @u_hossein

03/03/2022 at 02:53AM

45
#37 - Alex / @AlexanderHeatl2

07/26/2022 at 09:33PM

46
#38 - Chris Conte / @chriscconte

02/11/2021 at 02:04AM

46
#39 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 06:09PM

47
#40 - Smylers / @Smylers2

02/04/2021 at 09:33AM

47
#41 - Bspammer / @Bspammer

08/15/2021 at 02:39PM

48
#42 - Paul Inc / @hiniol1982

02/05/2021 at 07:42PM

48
#43 - constap / @constap

04/25/2024 at 10:26PM

49
#44 - grsh / @girish_i_am

05/23/2021 at 12:00PM

50
#45 - Daniel Qu / @danielq9871

05/10/2021 at 04:47PM

50
#46 - Vahan / @Vahan00900245

10/06/2021 at 03:17PM

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

03/18/2021 at 02:40PM

53
#48 - philip / @philip5530

03/03/2022 at 02:46AM

53
#49 - James Hayden / @don_jaime

10/22/2022 at 05:34AM

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

02/03/2021 at 01:54PM

54
#51 - syuusaku / @GSyuusaku

02/20/2021 at 11:31AM

54
#52 - huscarl / @huscarl6

05/20/2021 at 04:38AM

54
#53 - Arjan Verkerk / @adverkerk

03/30/2022 at 08:47AM

55
#54 - Michael / @triorph

11/10/2021 at 07:38AM

55
#55 - Druhan Shah / @DruhanShah

01/14/2024 at 08:59AM

56
#56 - rappenstein2 / @rappenstein2

01/13/2022 at 10:36PM

56
#57 - JVIM / @JVIM101

02/22/2022 at 12:39PM

57
#58 - idontwantaaccount / @fkURaccounts

11/30/2022 at 05:31PM

58
#59 - simplelife2010 / @simplelife20101

05/13/2021 at 12:26PM

59
#60 - Dmitry Antonyuk / @dm_antonyuk

08/24/2021 at 05:14PM