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 5b6e21c9a893790006232531

Swap the operands under comparison

Swap the operands under comparison to prevent null pointer exception (at least in java)

Start file
if(lang.equals("en_US")) {
	System.out.println("The lang is en_US i.e english US"+
}

if(lang.equals("es_US")) {
	System.out.println("The lang is es_US i.e spanish US"+
}

if(lang.equals("fr_US")) {
	System.out.println("The lang is fr_US i.e france US"+
}
End file
if("en_US".equals(lang)) {
	System.out.println("The lang is en_US i.e english US"+
}

if("es_US".equals(lang)) {
	System.out.println("The lang is es_US i.e spanish US"+
}

if("fr_US".equals(lang)) {
	System.out.println("The lang is fr_US i.e france US"+
}

View Diff

1c1
< if(lang.equals("en_US")) {
---
> if("en_US".equals(lang)) {
5c5
< if(lang.equals("es_US")) {
---
> if("es_US".equals(lang)) {
9c9
< if(lang.equals("fr_US")) {
---
> if("fr_US".equals(lang)) {

Solutions by @dimkino:

Unlock 7 remaining solutions by signing in and submitting your own entry
Created by: @saurabh908583

90 active golfers, 251 entries

Solutions by @dimkino:
19
#18 - Дима / @dimkino

05/31/2019 at 10:33AM

20
#>35 - Дима / @dimkino

05/31/2019 at 10:32AM

21
#>40 - Дима / @dimkino

05/31/2019 at 10:31AM

22
#>44 - Дима / @dimkino

05/31/2019 at 10:30AM

23
#>50 - Дима / @dimkino

05/31/2019 at 10:29AM

25
#>60 - Дима / @dimkino

05/31/2019 at 10:29AM

26
#>68 - Дима / @dimkino

05/31/2019 at 10:28AM