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 50ba20af5b346c0002000035

Python: Lots of function arguments

The function definition is too long for one line. The modeline helps you with some typical Python indent settings.

Start file
class Pointless:
    def lotsa_arguments(self, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, thirteenth, fourteenth, sixteenth, seventeenth, eighteenth, nineteenth, twentieth, twenty_first, twenty_second, twenty_third):
        "Doesn't even use all those arguments. What a waste."
        pass


# File-specific indent settings!
# More VimGolf challenges need modelines.
# vim: set sw=4 et ft=python:
End file
class Pointless:
    def lotsa_arguments(self, first, second, third, fourth, fifth, sixth,
                        seventh, eighth, ninth, tenth, eleventh, twelfth,
                        thirteenth, fourteenth, sixteenth, seventeenth,
                        eighteenth, nineteenth, twentieth, twenty_first,
                        twenty_second, twenty_third):
        "Doesn't even use all those arguments. What a waste."
        pass


# File-specific indent settings!
# More VimGolf challenges need modelines.
# vim: set sw=4 et ft=python:

View Diff

2c2,6
<     def lotsa_arguments(self, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, thirteenth, fourteenth, sixteenth, seventeenth, eighteenth, nineteenth, twentieth, twenty_first, twenty_second, twenty_third):
---
>     def lotsa_arguments(self, first, second, third, fourth, fifth, sixth,
>                         seventh, eighth, ninth, tenth, eleventh, twelfth,
>                         thirteenth, fourteenth, sixteenth, seventeenth,
>                         eighteenth, nineteenth, twentieth, twenty_first,
>                         twenty_second, twenty_third):

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 38 remaining solutions by signing in and submitting your own entry
#39 Austin Ware / @AustinWare17 - Score: 36 - 03/13/18 @ 05:30
/si<CR>wa<CR><Tab><Tab><Esc>/tw<CR>wa<CR><Esc>/se<CR>wa<CR><Esc>/fi<CR>wa<CR><Esc>ZZ

0 comments


Created by: @udioica

39 active golfers, 73 entries

Leaderboard (lowest score wins):
16
#31 - Yann Moisan / @YannMoisan

01/27/2013 at 12:59PM

16
#32 - Chris Berragan / @ChrisBerragan

02/04/2013 at 07:03PM

16
#33 - François Marais / @maraisf

09/16/2014 at 06:47PM

16
#34 - James / @Dronak

09/21/2014 at 02:18AM

23
#35 - Sebastien MICHEL / @michoux

12/06/2012 at 01:43PM

29
#36 - Niil Öhlin / @Niil94

03/04/2013 at 09:49PM

29
#37 - まがい / @xxmagai

03/02/2015 at 02:16PM

31
#38 - Ravi S Sinha / @ambidextrousTx

12/02/2012 at 03:57PM

36
#39 - Austin Ware / @AustinWare17

03/13/2018 at 05:30AM