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 by @russellzhaomao:

Unlock 13 remaining solutions by signing in and submitting your own entry
Created by: @buzbone

71 active golfers, 247 entries

Solutions by @russellzhaomao:
16
#8 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:22PM

17
#>30 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:21PM

18
#>38 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:20PM

19
#>41 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:19PM

21
#>45 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:18PM

22
#>47 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:18PM

23
#>54 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:17PM

24
#>58 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:06PM

25
#>60 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:03PM

29
#>65 - russellzhaomao / @russellzhaomao

06/05/2022 at 12:00PM

30
#>66 - russellzhaomao / @russellzhaomao

06/05/2022 at 11:58AM

32
#>68 - russellzhaomao / @russellzhaomao

06/05/2022 at 11:57AM

33
#>68 - russellzhaomao / @russellzhaomao

06/05/2022 at 11:53AM