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 545baafb7974800002353443

Replace Parameter with Explicit Methods

Implementing the methods of a Java Interface

Start file
import ch.xyz.Logger;

public class LoggerImpl implements Logger {

	private void log(LogLevel lvl, String str) {
		/* Code */
	}

	@Override
	public void emerge(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void alert(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void critical(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void warning(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void notice(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void info(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void debug(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

}
End file
import ch.xyz.Logger;

public class LoggerImpl implements Logger {

	private void log(LogLevel lvl, String str) {
		/* Code */
	}

	@Override
	public void emerge(String str) {
		log(LogLevel.EMERGE, str);
	}

	@Override
	public void alert(String str) {
		log(LogLevel.ALERT, str);
	}

	@Override
	public void critical(String str) {
		log(LogLevel.CRITICAL, str);
	}

	@Override
	public void warning(String str) {
		log(LogLevel.WARNING, str);
	}

	@Override
	public void notice(String str) {
		log(LogLevel.NOTICE, str);
	}

	@Override
	public void info(String str) {
		log(LogLevel.INFO, str);
	}

	@Override
	public void debug(String str) {
		log(LogLevel.DEBUG, str);
	}

}

View Diff

11c11
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.EMERGE, str);
16c16
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.ALERT, str);
21c21
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.CRITICAL, str);
26c26
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.WARNING, str);
31c31
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.NOTICE, str);
36c36
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.INFO, str);
41c41
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.DEBUG, str);

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 25 remaining solutions by signing in and submitting your own entry
#26 Erik Buček / @_EnterNameHere_ - Score: 51 - 11/19/14 @ 09:54
9jqq3wywjddOlog(LogLevel.<Esc>"0pbveUA, str);<Esc>4j0q6@qZZ

0 comments


#27 Oliver Christ / @0liverChrist - Score: 51 - 02/13/15 @ 21:37
10Gqqww"ayt(+Clog(LogLevel.<C-R>a, str);<Esc>T.vt,~4+q6@qZZ

0 comments


Created by: @etifiux

27 active golfers, 76 entries

Leaderboard (lowest score wins):
33
#1 - Urtica dioica / @udioica

11/06/2014 at 07:59PM

33
#2 - John Braxler / @braxler

11/12/2014 at 10:36PM

33
#3 - Peppa Pig / @PeppaPi95550250

07/03/2024 at 03:49AM

33
#4 - nickGPT / @nickandbro

08/28/2024 at 11:06AM

34
#5 - Jon Krause / @jkrause314

03/09/2016 at 02:42AM

35
#6 - Petro Тrouq / @zulolosi

11/09/2014 at 06:33PM

35
#7 - Carlos López / @morrizon

11/20/2014 at 10:58AM

37
#8 - Tim Chase / @gumnos

11/06/2014 at 07:33PM

37
#9 - Carlos A Henríquez Q / @lagunex

01/17/2015 at 09:18PM

38
#10 - Hans Liu / @zhansliu

11/06/2014 at 06:35PM

38
#11 - Marcelo Montu / @_mMontu_

11/07/2014 at 06:23PM

38
#12 - Arijus / @argshook

08/04/2016 at 02:15PM

41
#13 - CJ Avilla / @cjav_dev

11/06/2014 at 06:04PM

41
#14 - r. / @rmarvie

12/19/2014 at 10:08PM

42
#15 - mnx / @mnxx

11/07/2014 at 01:48PM

43
#16 - Éric Calvayrac / @xarmux2

11/07/2014 at 09:34PM

43
#17 - Matt / @mcr05

11/13/2014 at 02:07PM

44
#18 - Tautvilas / @TautviIas

08/04/2016 at 02:01PM

46
#19 - Gwilym Kuiper / @gwilymk

11/06/2014 at 06:30PM

48
#20 - James / @Dronak

11/06/2014 at 06:05PM

49
#21 - Mauro Persano / @fzort

11/21/2014 at 03:13PM

49
#22 - ♜ Pepe Doval / @pepellou

12/27/2014 at 12:22AM

49
#23 - Jake Eskel / @JakeEskel

12/30/2014 at 03:34PM

49
#24 - Piotr Kowenzowski / @sacherus

10/07/2015 at 09:05PM

50
#25 - Ram Tamtam / @ramtamtamtam

11/07/2014 at 09:07AM

51
#26 - Erik Buček / @_EnterNameHere_

11/19/2014 at 09:54AM

51
#27 - Oliver Christ / @0liverChrist

02/13/2015 at 09:37PM