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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 44 remaining solutions by signing in and submitting your own entry
#45 testingvimgolf / @testingvimgolf - Score: 55 - 08/12/18 @ 03:23
fldwf(pldf"Fflp4jFldwf(pldf"Fflp4jFldwf(pldf"F9Fflp:wq<CR>

0 comments


Created by: @saurabh908583

45 active golfers, 126 entries

Leaderboard (lowest score wins):
19
#1 - Kerson Hsiao / @KersonHsiao

08/12/2018 at 03:27AM

19
#2 - Pratik / @prathik_t

08/12/2018 at 11:36AM

19
#3 - John Braxler / @braxler

08/13/2018 at 11:55AM

19
#4 - Smylers / @Smylers2

08/13/2018 at 02:00PM

19
#5 - Keldwik Chaldain / @Suskeyhose

08/14/2018 at 08:43PM

19
#6 - fucus / @fishlovebanana

08/19/2018 at 07:27AM

19
#7 - Epecb / @BceEpecb

09/05/2018 at 12:41AM

19
#8 - Jeff / @sir_wiggles3

09/07/2018 at 09:50AM

19
#9 - Rich Cheng / @sedm0784

09/10/2018 at 03:29PM

19
#10 - royer / @RoyerMoyer1

09/15/2018 at 12:03AM

19
#11 - Turkey Man / @lvturkeyman

09/21/2018 at 03:45AM

20
#12 - Jon Krause / @jkrause314

08/11/2018 at 12:59AM

20
#13 - Javier Blanco / @jbgutierrez

08/11/2018 at 09:08AM

20
#14 - PCS Solutions / @PeteSolutions

08/11/2018 at 11:11AM

20
#15 - Piotr Walkusz / @piotrwalkusz1

08/11/2018 at 03:36PM

20
#16 - tPenguinLTG / @tpenguinltg

08/12/2018 at 03:52AM

20
#17 - 🌀🦋Miriam Retka🦋🌀 / @miriamretka

08/19/2018 at 08:59PM

20
#18 - Cam Smith / @Comradesmith

08/21/2018 at 10:37AM

20
#19 - Joey / @joeyism101

09/03/2018 at 02:08AM

21
#20 - Valacar / @valacar

08/16/2018 at 07:20AM

21
#21 - Артем Мухометзянов / @Timon_Surikat

08/18/2018 at 11:13PM

21
#22 - Daniel Vaqueiro / @chimidea

09/01/2018 at 12:51AM

22
#23 - Weston Neal / @wtneal

09/04/2018 at 10:11PM

23
#24 - 村橋究理基M.Kuriki@北大 / @mkuriki_

08/11/2018 at 12:24PM

23
#25 - 徐学健 / @zebrallel

08/15/2018 at 10:21AM

23
#26 - daniel / @daniel31464605

08/22/2018 at 06:04AM

24
#27 - Kritixi Lithos / @kritixilithos

08/11/2018 at 11:54AM

24
#28 - h43z / @h43z

08/11/2018 at 11:16PM

24
#29 - Marco Magdy / @marcomcdee

08/13/2018 at 07:57PM

24
#30 - 安藤 / @andou2106

09/03/2018 at 03:47PM