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

72 active golfers, 259 entries

Leaderboard (lowest score wins):
25
#61 - Daniel Lundin / @danielundin

06/17/2012 at 02:12PM

27
#62 - noom narze / @NarzE

06/15/2012 at 11:36AM

27
#63 - Nipunn Koorapati / @nipunn1313

07/21/2012 at 05:32PM

27
#64 - James / @Dronak

09/18/2014 at 09:30PM

28
#65 - Toto l'haricot / @nico_le_terribl

07/05/2012 at 06:15PM

29
#66 - guotuofeng / @guotuofeng

11/09/2012 at 09:26AM

30
#67 - Nikita Mikhaylov / @nslqqq

07/08/2012 at 02:55PM

32
#68 - Arto Vuori / @dhpe

08/31/2012 at 07:06PM

32
#69 - RockerZZY / @rocker_zzy

06/04/2020 at 11:26PM

38
#70 - shahanavaz m / @shahanavazm

03/20/2024 at 05:13PM

55
#71 - Samuel Ytterbrink / @Neppord

06/23/2012 at 01:48AM

89
#72 - Justin Knag / @justinknag

09/13/2014 at 03:39PM