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 4fdb12a383de630001000005

Aligning function arguments to match a specific coding style

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

Start file
void
clutter_layout_manager_get_preferred_width (ClutterActor *actor,
                                            ClutterContainer *container,
                                            gfloat for_width,
                                            gfloat *min_width_p,
                                            gfloat *natural_width_p)
{
}
End file
void
clutter_layout_manager_get_preferred_width (ClutterActor     *actor,
                                            ClutterContainer *container,
                                            gfloat            for_width,
                                            gfloat           *min_width_p,
                                            gfloat           *natural_width_p)
{
}

View Diff

2c2
< clutter_layout_manager_get_preferred_width (ClutterActor *actor,
---
> clutter_layout_manager_get_preferred_width (ClutterActor     *actor,
4,6c4,6
<                                             gfloat for_width,
<                                             gfloat *min_width_p,
<                                             gfloat *natural_width_p)
---
>                                             gfloat            for_width,
>                                             gfloat           *min_width_p,
>                                             gfloat           *natural_width_p)

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 59 remaining solutions by signing in and submitting your own entry
#60 Justin Knag / @justinknag - Score: 89 - 09/13/14 @ 15:39
j$bhi    <Esc>jjbblllllli           jj<BS><BS><Esc>jbbi           j<BS><Esc>jjkkui          <Esc>jbbi          <Esc>ZZ

0 comments


Created by: @buzbone

60 active golfers, 160 entries

Leaderboard (lowest score wins):
19
#31 - Justin Love / @wondible

06/15/2012 at 01:49PM

19
#32 - Greg Sabo / @gregsabo

06/21/2012 at 03:54AM

19
#33 - Steve Tjoa / @stevetjoa

07/04/2013 at 07:26AM

21
#34 - Øystein Walle / @oysteinwalle

06/16/2012 at 05:53PM

21
#35 - 無ん垢の叫び / @john_ababa

06/22/2012 at 02:56PM

21
#36 - cj / @cj01101

10/22/2013 at 05:24PM

21
#37 - Joonas Pihlajamaa / @jokkebk

03/14/2014 at 05:57PM

22
#38 - Sune Simonsen / @sunesimonsen

08/27/2012 at 07:07PM

22
#39 - Underhill Labs / @underhilllabs

10/30/2012 at 05:32AM

23
#40 - Kerson Hsiao / @KersonHsiao

06/15/2012 at 01:07PM

23
#41 - exitmouse / @exitmouse

06/20/2012 at 08:36PM

23
#42 - proglottis / @proglottis

06/23/2012 at 11:52AM

23
#43 - Aaron Miller / @apage43

08/13/2012 at 01:58AM

23
#44 - Michael Limiero / @michaellimiero

08/13/2012 at 11:42PM

23
#45 - Édouard M'tou / @DouardM

10/09/2012 at 12:05PM

23
#46 - powertomato / @powertomato

07/04/2013 at 08:22AM

24
#47 - Glen / @Glen_S

08/01/2012 at 01:22PM

24
#48 - Reed Riley / @ReedRile

08/12/2012 at 07:40PM

24
#49 - Sean Griffin / @sgrif

08/13/2012 at 01:32AM

25
#50 - Daniel Lundin / @danielundin

06/17/2012 at 02:12PM

27
#51 - noom narze / @NarzE

06/15/2012 at 11:36AM

27
#52 - Nipunn Koorapati / @nipunn1313

07/21/2012 at 05:32PM

27
#53 - James / @Dronak

09/18/2014 at 09:30PM

28
#54 - Toto l'haricot / @nico_le_terribl

07/05/2012 at 06:15PM

29
#55 - guotuofeng / @guotuofeng

11/09/2012 at 09:26AM

30
#56 - Nikita Mikhaylov / @nslqqq

07/08/2012 at 02:55PM

32
#57 - Arto Vuori / @dhpe

08/31/2012 at 07:06PM

32
#58 - RockerZZY / @rocker_zzy

06/04/2020 at 11:26PM

55
#59 - Samuel Ytterbrink / @Neppord

06/23/2012 at 01:48AM

89
#60 - Justin Knag / @justinknag

09/13/2014 at 03:39PM