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):
18
#31 - John Whitley / @johnwhitley

06/15/2012 at 05:25PM

18
#32 - RusAlex Pletnev / @RusAlexander

06/17/2012 at 01:24PM

18
#33 - binoymichael / @binoymichael

06/19/2012 at 02:35PM

18
#34 - Pandae / @psasqw

06/20/2012 at 10:06PM

18
#35 - James Davis / @tripvg

08/04/2012 at 09:25PM

18
#36 - retired account / @retired10072015

08/24/2012 at 06:31PM

18
#37 - tmr / @tmr314

09/09/2012 at 07:54PM

18
#38 - Johan Berg / @_berg85

02/14/2014 at 10:09AM

18
#39 - Eng. José Esteves / @JGEsteves89

02/16/2025 at 02:19PM

19
#40 - Justin Love / @wondible

06/15/2012 at 01:49PM

19
#41 - Greg Sabo / @gregsabo

06/21/2012 at 03:54AM

19
#42 - Steve Tjoa / @stevetjoa

07/04/2013 at 07:26AM

21
#43 - Øystein Walle / @oysteinwalle

06/16/2012 at 05:53PM

21
#44 - じょんあば / @john_ababa

06/22/2012 at 02:56PM

21
#45 - cj / @cj01101

10/22/2013 at 05:24PM

21
#46 - Joonas Pihlajamaa / @jokkebk

03/14/2014 at 05:57PM

22
#47 - Sune Simonsen / @sunesimonsen

08/27/2012 at 07:07PM

22
#48 - Underhill Labs / @underhilllabs

10/30/2012 at 05:32AM

23
#49 - Kerson Hsiao / @KersonHsiao

06/15/2012 at 01:07PM

23
#50 - exitmouse / @exitmouse

06/20/2012 at 08:36PM

23
#51 - proglottis / @proglottis

06/23/2012 at 11:52AM

23
#52 - Aaron Miller / @apage43

08/13/2012 at 01:58AM

23
#53 - Michael Limiero / @michaellimiero

08/13/2012 at 11:42PM

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

10/09/2012 at 12:05PM

23
#55 - powertomato / @powertomato

07/04/2013 at 08:22AM

23
#56 - Kanmuruuruu / @Kanmuruuruu

04/07/2024 at 09:43AM

24
#57 - Glen / @Glen_S

08/01/2012 at 01:22PM

24
#58 - Reed Riley / @ReedRile

08/12/2012 at 07:40PM

24
#59 - Sean Griffin / @sgrif

08/13/2012 at 01:32AM

24
#60 - Paul McDowell / @etothepi16

06/16/2024 at 07:40PM