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 31 remaining solutions by signing in and submitting your own entry
#32 testingvimgolf / @testingvimgolf - Score: 55 - 08/12/18 @ 03:23
fldwf(pldf"Fflp4jFldwf(pldf"Fflp4jFldwf(pldf"F9Fflp:wq<CR>

0 comments


Created by: @saurabh908583

32 active golfers, 78 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

20
#7 - Jon Krause / @jkrause314

08/11/2018 at 12:59AM

20
#8 - Javier Blanco / @jbgutierrez

08/11/2018 at 09:08AM

20
#9 - PCS Solutions / @PeteSolutions

08/11/2018 at 11:11AM

20
#10 - Piotr Walkusz / @piotrwalkusz1

08/11/2018 at 03:36PM

20
#11 - tPenguinLTG / @tpenguinltg

08/12/2018 at 03:52AM

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

08/19/2018 at 08:59PM

21
#13 - Valacar / @valacar

08/16/2018 at 07:20AM

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

08/18/2018 at 11:13PM

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

08/11/2018 at 12:24PM

23
#16 - 徐学健 / @zebrallel

08/15/2018 at 10:21AM

24
#17 - Kritixi Lithos / @kritixilithos

08/11/2018 at 11:54AM

24
#18 - h43z / @h43z

08/11/2018 at 11:16PM

24
#19 - Marco Magdy / @marcomcdee

08/13/2018 at 07:57PM

25
#20 - daniel / @daniel31464605

08/20/2018 at 02:58PM

26
#21 - yqu212 / @yqu212

08/11/2018 at 02:23AM

26
#22 - Kristijan Husak / @kristijan_husak

08/11/2018 at 05:43PM

26
#23 - Dr Rev J. '𝕵. 𝕶𝖎𝖗𝖈𝖍𝖆𝖗𝖙𝖟' Kirchartz / @JKirchartz

08/19/2018 at 05:11AM

27
#24 - Christian Fosli / @porridge111

08/12/2018 at 07:17PM

27
#25 - Alexander Zheleznov / @ephemerr

08/17/2018 at 09:16AM

27
#26 - Sergio / @voyeg3r

08/19/2018 at 04:15PM

27
#27 - Roberto Martínez / @nilp0inter

08/20/2018 at 09:17PM

28
#28 - Vanildo S. Mangueira / @vanildo_souto

08/13/2018 at 01:51PM

37
#29 - Miki Tebeka / @tebeka

08/12/2018 at 05:13AM

39
#30 - saurabh tripathi / @saurabh908583

08/10/2018 at 11:39PM