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 20 remaining solutions by signing in and submitting your own entry
#21 Jake Eskel / JakeEskel - Score: 49 - 12/30/14 @ 15:34
qq/th<CR>DAlog(LogLevel., str);<Esc>k^2wveyjf.pvbUq6@qZZ

0 comments

#22 Piotr Kowenzowski / sacherus - Score: 49 - 10/07/15 @ 21:05
9jqq3wywolog(LogLevel.<Esc>pvb~A, str);<Esc>jdd3jh@qq@qZZ

0 comments

#23 Ram Tamtam / ramtamtamtam - Score: 50 - 11/07/14 @ 09:07
10Gqq2wyej"_cclog(LogLevel.<C-R>", str);<Esc>4bgUe4+q6@qZZ

0 comments

#24 Erik Buček / _EnterNameHere_ - Score: 51 - 11/19/14 @ 09:54
9jqq3wywjddOlog(LogLevel.<Esc>"0pbveUA, str);<Esc>4j0q6@qZZ

0 comments

#25 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: etiennefux

25 active golfers, 61 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

34
#3 - Jon Krause / jkrause314

03/09/2016 at 02:42AM

35
#4 - Petro Тrouq / zulolosi

11/09/2014 at 06:33PM

35
#5 - Carlos López / morrizon

11/20/2014 at 10:58AM

37
#6 - Tim Chase / gumnos

11/06/2014 at 07:33PM

37
#7 - Carlos A Henríquez Q / lagunex

01/17/2015 at 09:18PM

38
#8 - Hans Liu / zhansliu

11/06/2014 at 06:35PM

38
#9 - Marcelo Montu / _mMontu_

11/07/2014 at 06:23PM

38
#10 - Arijus / argshook

08/04/2016 at 02:15PM

41
#11 - w1zeman1p / wizemanip

11/06/2014 at 06:04PM

41
#12 - r. / rmarvie

12/19/2014 at 10:08PM

42
#13 - mnx / mnxx

11/07/2014 at 01:48PM

43
#14 - Éric Calvayrac / xarmux2

11/07/2014 at 09:34PM

43
#15 - Matthieu Crapet / mcr05

11/13/2014 at 02:07PM

44
#16 - Tautvilas / TautviIas

08/04/2016 at 02:01PM

46
#17 - Gwilym Kuiper / gwilymk

11/06/2014 at 06:30PM

48
#18 - James / Dronak

11/06/2014 at 06:05PM

49
#19 - Mauro Persano / fzort

11/21/2014 at 03:13PM

49
#20 - ♜ Pepe Doval / pepellou

12/27/2014 at 12:22AM

49
#21 - Jake Eskel / JakeEskel

12/30/2014 at 03:34PM

49
#22 - Piotr Kowenzowski / sacherus

10/07/2015 at 09:05PM

50
#23 - Ram Tamtam / ramtamtamtam

11/07/2014 at 09:07AM

51
#24 - Erik Buček / _EnterNameHere_

11/19/2014 at 09:54AM

51
#25 - Oliver Christ / 0liverChrist

02/13/2015 at 09:37PM