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

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

58 active golfers, 207 entries

Solutions by @kok89428331:
89
#2 - kok / @kok89428331

07/25/2020 at 03:01PM

91
#>6 - kok / @kok89428331

07/25/2020 at 02:58PM

92
#>9 - kok / @kok89428331

07/25/2020 at 02:56PM

94
#>10 - kok / @kok89428331

07/25/2020 at 02:53PM

95
#>11 - kok / @kok89428331

07/25/2020 at 02:50PM

96
#>12 - kok / @kok89428331

07/25/2020 at 02:43PM

97
#>13 - kok / @kok89428331

07/25/2020 at 02:36PM

98
#>14 - kok / @kok89428331

07/25/2020 at 02:07PM

98
#>14 - kok / @kok89428331

07/25/2020 at 02:21PM

99
#>16 - kok / @kok89428331

07/25/2020 at 02:04PM

100
#>17 - kok / @kok89428331

07/25/2020 at 02:01PM

105
#>18 - kok / @kok89428331

07/25/2020 at 01:54PM

106
#>20 - kok / @kok89428331

07/25/2020 at 01:43PM

108
#>21 - kok / @kok89428331

07/25/2020 at 01:40PM

109
#>22 - kok / @kok89428331

07/25/2020 at 01:33PM

113
#>27 - kok / @kok89428331

07/25/2020 at 01:29PM

114
#>28 - kok / @kok89428331

07/25/2020 at 01:24PM

115
#>28 - kok / @kok89428331

07/25/2020 at 01:19PM

122
#>35 - kok / @kok89428331

07/25/2020 at 01:09PM

129
#>41 - kok / @kok89428331

07/25/2020 at 01:04PM

135
#>44 - kok / @kok89428331

07/25/2020 at 12:53PM

137
#>45 - kok / @kok89428331

07/25/2020 at 12:24PM

141
#>46 - kok / @kok89428331

07/25/2020 at 12:16PM

144
#>49 - kok / @kok89428331

07/25/2020 at 12:22PM

145
#>49 - kok / @kok89428331

07/25/2020 at 11:54AM

150
#>50 - kok / @kok89428331

07/25/2020 at 11:29AM

223
#>54 - kok / @kok89428331

07/25/2020 at 11:10AM

290
#>55 - kok / @kok89428331

07/25/2020 at 10:37AM

381
#>58 - kok / @kok89428331

07/25/2020 at 09:22AM