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

Getters & Setters: Java

Boilerplate getters & setters - it's a tedious fact of life in Java, and probably the only thing that still pulls me back to an IDE. Perhaps someone knows a fast, pure vim way...

Start file
package com.vimgolf.challenge;

public class Person {
       
private String firstName;
       
private String surname;
       
private Integer age;
}
End file
package com.vimgolf.challenge;

public class Person {
       
private String firstName;
       
private String surname;
       
private Integer age;

       
public String getFirstName() { return firstName; }
       
public void setFirstName( String firstName ) {
               
this.firstName = firstName;
       
}

       
public String getSurname() { return surname; }
       
public void setSurname( String surname ) {
               
this.surname = surname;
       
}

       
public Integer getAge() { return age; }
       
public void setAge( Integer age ) {
               
this.age = age;
       
}
}

View Diff

6a7,21
>
>       public String getFirstName() { return firstName; }
>       public void setFirstName( String firstName ) {
>               this.firstName = firstName;
>       }
>
>       public String getSurname() { return surname; }
>       public void setSurname( String surname ) {
>               this.surname = surname;
>       }
>
>       public Integer getAge() { return age; }
>       public void setAge( Integer age ) {
>               this.age = age;
>       }

Solutions by @NolenRoyalty:

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

59 active golfers, 211 entries

Solutions by @NolenRoyalty:
95
#11 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 09:43PM

95
#>11 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 09:45PM

96
#>12 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 09:02PM

98
#>13 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:59PM

99
#>16 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:49PM

101
#>17 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 06:34AM

102
#>17 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:45PM

103
#>17 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:07PM

103
#>17 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:30PM

105
#>18 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:21PM

110
#>22 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 06:16AM

112
#>25 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 05:29AM

115
#>28 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 05:24AM