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

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

58 active golfers, 207 entries

Solutions by @vimgolfer7:
91
#6 - vimgolfer / @vimgolfer7

10/06/2019 at 03:16AM

92
#>9 - vimgolfer / @vimgolfer7

10/06/2019 at 02:53AM

94
#>10 - vimgolfer / @vimgolfer7

10/06/2019 at 02:43AM

95
#>11 - vimgolfer / @vimgolfer7

10/06/2019 at 02:35AM

96
#>12 - vimgolfer / @vimgolfer7

10/06/2019 at 02:16AM

98
#>14 - vimgolfer / @vimgolfer7

10/06/2019 at 02:05AM

99
#>16 - vimgolfer / @vimgolfer7

10/06/2019 at 02:04AM

100
#>17 - vimgolfer / @vimgolfer7

10/06/2019 at 02:02AM

105
#>18 - vimgolfer / @vimgolfer7

10/06/2019 at 01:59AM

106
#>20 - vimgolfer / @vimgolfer7

10/06/2019 at 01:50AM

109
#>22 - vimgolfer / @vimgolfer7

10/06/2019 at 01:44AM

109
#>22 - vimgolfer / @vimgolfer7

10/06/2019 at 01:47AM

111
#>24 - vimgolfer / @vimgolfer7

10/06/2019 at 01:37AM