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

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

1614 active golfers, 6557 entries

Solutions by @Robottinosino:
32
#53 - Robottinosino / @Robottinosino

05/18/2013 at 06:52AM

32
#>53 - Robottinosino / @Robottinosino

05/18/2013 at 06:57AM

33
#>222 - Robottinosino / @Robottinosino

05/18/2013 at 06:48AM

34
#>291 - Robottinosino / @Robottinosino

05/18/2013 at 06:45AM

35
#>341 - Robottinosino / @Robottinosino

05/18/2013 at 06:42AM

36
#>428 - Robottinosino / @Robottinosino

05/18/2013 at 06:34AM

38
#>592 - Robottinosino / @Robottinosino

05/18/2013 at 06:28AM

39
#>684 - Robottinosino / @Robottinosino

05/18/2013 at 06:12AM

39
#>684 - Robottinosino / @Robottinosino

05/18/2013 at 06:20AM

40
#>768 - Robottinosino / @Robottinosino

05/18/2013 at 06:10AM

40
#>768 - Robottinosino / @Robottinosino

05/18/2013 at 06:17AM

41
#>849 - Robottinosino / @Robottinosino

05/18/2013 at 05:50AM

44
#>1047 - Robottinosino / @Robottinosino

05/18/2013 at 12:20AM

45
#>1091 - Robottinosino / @Robottinosino

05/18/2013 at 12:14AM

50
#>1322 - Robottinosino / @Robottinosino

05/18/2013 at 12:10AM

51
#>1344 - Robottinosino / @Robottinosino

05/18/2013 at 12:03AM