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 57343555fd77ad227900df4a

Split line with dots

This line is too long, split it.

Start file
class VimGolf
  def split_me
    MyModel.first_method.second_method(arg).third_method(arg.method_one.method_two)
  end
end
End file
class VimGolf
  def split_me
    MyModel
      .first_method
      .second_method(arg)
      .third_method(arg.method_one.method_two)
  end
end

View Diff

3c3,6
<     MyModel.first_method.second_method(arg).third_method(arg.method_one.method_two)
---
>     MyModel
>       .first_method
>       .second_method(arg)
>       .third_method(arg.method_one.method_two)

Solutions by @russellzhaomao:

Unlock 10 remaining solutions by signing in and submitting your own entry
Created by: @Benoit_Tgt

634 active golfers, 2144 entries

Solutions by @russellzhaomao:
18
#312 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:49AM

19
#>353 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:46AM

20
#>386 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:27AM

21
#>441 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:24AM

22
#>470 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:20AM

23
#>496 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:18AM

25
#>535 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:16AM

25
#>535 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:17AM

26
#>564 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:05AM

28
#>586 - russellzhaomao / @russellzhaomao

05/26/2022 at 11:04AM