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 @ArtStandAlone:

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

1759 active golfers, 7171 entries

Solutions by @ArtStandAlone:
32
#100 - kiho choi / @ArtStandAlone

04/24/2014 at 11:07AM

33
#>244 - kiho choi / @ArtStandAlone

04/24/2014 at 10:27AM

34
#>305 - kiho choi / @ArtStandAlone

04/24/2014 at 10:07AM

34
#>305 - kiho choi / @ArtStandAlone

04/24/2014 at 10:14AM

35
#>369 - kiho choi / @ArtStandAlone

04/24/2014 at 09:58AM

36
#>458 - kiho choi / @ArtStandAlone

04/24/2014 at 05:08AM

37
#>551 - kiho choi / @ArtStandAlone

04/24/2014 at 03:03AM

38
#>638 - kiho choi / @ArtStandAlone

04/24/2014 at 02:53AM

40
#>829 - kiho choi / @ArtStandAlone

04/24/2014 at 02:41AM

41
#>907 - kiho choi / @ArtStandAlone

04/24/2014 at 02:37AM

42
#>982 - kiho choi / @ArtStandAlone

04/23/2014 at 01:00PM

44
#>1121 - kiho choi / @ArtStandAlone

04/23/2014 at 12:51PM

62
#>1613 - kiho choi / @ArtStandAlone

04/23/2014 at 12:45PM