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

71 active golfers, 247 entries

Leaderboard (lowest score wins):
16
#1 - Urtica dioica / @udioica

08/08/2014 at 10:42AM

16
#2 - John Braxler / @braxler

12/22/2014 at 03:28PM

16
#3 - Andres Araya / @arayaandresfco

07/25/2016 at 07:14PM

16
#4 - Martin Delille / @martinodelilo

09/01/2019 at 04:22PM

16
#5 - Jon Krause / @jkrause314

12/20/2020 at 07:12AM

16
#6 - 조성식 / @Y9eKW0qxvsdIN6W

03/25/2021 at 07:23AM

16
#7 - 時空裂縫 / @0xdcbf

07/04/2021 at 12:36PM

16
#8 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:22PM

16
#9 - Qing Liu / @poeminlash

08/14/2022 at 01:20AM

16
#10 - Janzen / @__Coos

09/25/2022 at 04:08PM

16
#11 - Peppa Pig / @PeppaPigSg

07/03/2024 at 07:08AM

16
#12 - nickGPT / @nickandbro

08/28/2024 at 08:45PM

17
#13 - h_east (トロッコ6個) / @h_east

06/15/2012 at 11:31AM

17
#14 - Aaron Lake / @aaronmlake

06/15/2012 at 11:35AM

17
#15 - Tim Chase / @gumnos

06/15/2012 at 01:08PM

17
#16 - Rolf Bjaanes / @rolfb

06/15/2012 at 01:35PM

17
#17 - Conner McDaniel / @connermcd

06/15/2012 at 02:14PM

17
#18 - Sebastian Kusnier / @skusnier

06/15/2012 at 05:26PM

17
#19 - Federico Galassi / @federicogalassi

06/18/2012 at 11:36PM

17
#20 - Vitaly Kushner / @vkushner

06/21/2012 at 12:08AM

17
#21 - Ilya Ermolin / @ermolinis

06/21/2012 at 06:18AM

17
#22 - Ryan O'Connell / @Salshammath

06/21/2012 at 01:00PM

17
#23 - abernardes / @abernardes

06/21/2012 at 03:46PM

17
#24 - John Dahlström / @dahlstromjohn

06/29/2012 at 11:37AM

17
#25 - Rod Knowlton / @codelahoma

07/08/2012 at 12:42AM

17
#26 - Alekseyka2 / @Alekseyka2

07/13/2012 at 11:53AM

17
#27 - Joseph J. Piché / @jjpiche

08/26/2012 at 12:10AM

17
#28 - Trevor Powell / @DoomedBunnies

04/16/2013 at 06:47AM

17
#29 - Marco Hinz / @_mhinz_

05/24/2013 at 06:02PM

17
#30 - yaon / @yaon4

09/10/2013 at 03:04PM