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

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

58 active golfers, 207 entries

Solutions by @lslah:
92
#8 - ls lahrs / @lslah

01/17/2011 at 04:35PM

100
#>16 - ls lahrs / @lslah

01/04/2011 at 03:31PM

101
#>17 - ls lahrs / @lslah

01/04/2011 at 03:28PM

105
#>17 - ls lahrs / @lslah

01/04/2011 at 03:22PM

108
#>20 - ls lahrs / @lslah

01/04/2011 at 03:12PM

115
#>28 - ls lahrs / @lslah

01/04/2011 at 03:03PM