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 4d1a1c36567bac34a9000002

Reformat/Refactor a Golfer Class

A simple case of removing unneeded code and fixing broken indentation.

Start file
class Golfer
     
def initialize; end # initialize
 
def useless; end;
 
     
def self.hello(a,b,c,d)
      puts
"Hello #{a}, #{b}, #{c}, #{d}"
   
end
end
End file
class Golfer
 
def self.hello(*a)
    puts
"Hello #{a.join(',')}"
 
end
end

View Diff

2,7c2,4
<      def initialize; end # initialize
<   def useless; end;
<  
<      def self.hello(a,b,c,d)
<       puts "Hello #{a}, #{b}, #{c}, #{d}"
<    end
---
>   def self.hello(*a)
>     puts "Hello #{a.join(',')}"
>   end

Solutions by @VoDuyVinh:

Unlock 11 remaining solutions by signing in and submitting your own entry
Created by: @igrigorik

1767 active golfers, 7195 entries

Solutions by @VoDuyVinh:
34
#305 - Võ Duy Vinh / @VoDuyVinh

02/23/2014 at 01:38AM

35
#>368 - Võ Duy Vinh / @VoDuyVinh

02/23/2014 at 01:34AM

35
#>368 - Võ Duy Vinh / @VoDuyVinh

02/26/2014 at 02:58AM

36
#>456 - Võ Duy Vinh / @VoDuyVinh

02/22/2014 at 06:06PM

37
#>550 - Võ Duy Vinh / @VoDuyVinh

02/22/2014 at 05:58PM

38
#>638 - Võ Duy Vinh / @VoDuyVinh

02/22/2014 at 05:56PM

38
#>638 - Võ Duy Vinh / @VoDuyVinh

02/26/2014 at 02:45AM

39
#>734 - Võ Duy Vinh / @VoDuyVinh

02/22/2014 at 05:54PM

40
#>828 - Võ Duy Vinh / @VoDuyVinh

02/22/2014 at 05:44PM

42
#>982 - Võ Duy Vinh / @VoDuyVinh

02/22/2014 at 05:35PM

44
#>1122 - Võ Duy Vinh / @VoDuyVinh

02/22/2014 at 05:27PM