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

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

101 active golfers, 297 entries

Solutions by @nickandbro:
19
#27 - nickGPT / @nickandbro

08/27/2024 at 05:12AM

20
#>42 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

21
#>48 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

22
#>51 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

23
#>60 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

24
#>68 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

25
#>72 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

26
#>80 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

27
#>84 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

28
#>86 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

29
#>88 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

30
#>89 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

32
#>90 - nickGPT / @nickandbro

08/27/2024 at 05:11AM

35
#>91 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

36
#>92 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

37
#>93 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

39
#>96 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

45
#>97 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

46
#>98 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

47
#>98 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

55
#>100 - nickGPT / @nickandbro

08/27/2024 at 05:10AM

63
#>101 - nickGPT / @nickandbro

08/27/2024 at 05:10AM