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 5078889ceedfc90002000047

Python to Ruby

Convert this Python code to Ruby. NOTE: This program likely won't run.

Start file
class PythonToRuby:
  def add(x, y):
    x + y

  n = add(1 + 1)
End file
class PythonToRuby
	def add(x, y)
		x + y
	end

	n = add(1, 2)
end

View Diff

1,3c1,4
< class PythonToRuby:
<   def add(x, y):
<     x + y
---
> class PythonToRuby
> 	def add(x, y)
> 		x + y
> 	end
5c6,7
<   n = add(1 + 1)
---
> 	n = add(1, 2)
> end

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 42 remaining solutions by signing in and submitting your own entry
#43 Alec Chen / alec929 - Score: 43 - 11/03/12 @ 13:47
$xjxjo<BS><BS>end<Esc>Gf1lxr,wr2o<BS><BS>end<Esc>:%s/  /\t/g<CR>ZZ

0 comments

#44 hiroaki yasutomo / kaminaly - Score: 43 - 09/04/13 @ 18:30
$xjxjo<BS><BS>end<Esc>Gf+r,hxwr2o<BS><BS>end<Esc>:%s/  /<C-V><Tab>/g<CR>ZZ

0 comments

#45 Glen / Glen_S - Score: 44 - 10/14/12 @ 12:36
3jO<Tab>end<Esc>Gf(ci(1, 2<Esc>o<C-U>end<Esc>:%s/  /\t/g|%s/:<CR>ZZ

0 comments

#46 cvp / cperepelitsa - Score: 44 - 10/29/12 @ 07:31
$xjxjo<BS><BS>end<Esc>:%s/  /\t/g<CR>o<C-D>end<Esc>k3f ct), 2<Esc>:x<CR>

0 comments

#47 Danilo / dbrgn - Score: 48 - 10/29/12 @ 21:34
$xjxjo<BS><BS>end<Esc>6G$hvhhhs, 2<Esc>oend<Esc><<:%s/  /\t/g<CR>:wq<CR>

0 comments

#48 Julien Etienne / ix4r - Score: 49 - 10/18/12 @ 21:38
$x<Down>x<Down><Down>i  end<CR><Esc>/+<CR>s<BS>, 2<Del><Del><kEnd><CR><BS><BS>end<Esc>:%s/  /\t/g<CR><Esc>:<BS>ZZ

0 comments

#49 Gurukandhamoorthi / Gurukandhamoor1 - Score: 50 - 08/30/17 @ 15:46
f:xj><Esc>x>>XXj>>>>XXXX<Esc>oend<Esc><<<Esc>jj>>XXf+Xr,<C-A>oend<Esc><<ZZ

0 comments

#50 Jeremy Peterson / dunderline - Score: 55 - 10/20/12 @ 23:34
$xjx:4<CR>i  end<CR><BS><BS><Esc><Down>o<BS><BS>end<Esc><Up>wwwwa,<Esc><Right><Right>xx<C-A>:%s/  /\t/g<CR><Esc>:wq<CR>

0 comments

#51 Steven Occhipinti / steveocchipinti - Score: 55 - 10/26/12 @ 04:06
:%s/  /\t/g<CR>oend<Esc><<kkkoend<Esc><<kkA<BS><Esc>kx/1<CR>l<C-A><Left><Left><Left>2x,<Esc>i,<Esc>:wq<CR>

0 comments

#52 Alain Gilbert / alain_gilbert - Score: 58 - 10/13/12 @ 02:16
A<BS><Down><BS><Esc>I<BS><BS><Tab><Esc>j>>>>I<BS><BS><BS><BS><Esc>oend<BS><BS><BS><BS>end<Esc><Down><Down><Right>xxxs, 2<Esc>>>I<BS><BS><Esc>o<BS>end<Esc>ZZ

0 comments

#53 Brandon Lee / bernardoodoo - Score: 67 - 10/24/12 @ 14:11
$xjxjo<BS><BS>end<Esc>/+<CR>nnhxr,ll<C-A>o<BS><BS>end<C-C><C-C>:<Up>s<BS>$<BS>%s/^\<BS>\s<BS><BS> <BS><BS>\ <BS><BS>  /\t/g<CR>:wq<CR>

0 comments

Created by: dynamic_library

53 active golfers, 184 entries

Leaderboard (lowest score wins):
24
#1 - Nathan / boysetsfrog

11/07/2012 at 07:45AM

25
#2 - Victor Ramirez / virako

10/21/2012 at 09:32PM

25
#3 - Conner McDaniel / connermcd

10/23/2012 at 02:20PM

25
#4 - Urtica dioica / udioica

12/12/2012 at 10:24AM

25
#5 - Marco Hinz / _mhinz_

05/28/2013 at 01:43PM

25
#6 - Petro Тrouq / zulolosi

06/08/2013 at 08:18AM

25
#7 - Bradd Szonye / bszonye

07/15/2013 at 02:02AM

25
#8 - Anton Davydov / anton_davydov

01/04/2014 at 04:38PM

25
#9 - John Braxler / braxler

05/14/2014 at 01:57PM

27
#10 - Kerson Hsiao / KersonHsiao

10/13/2012 at 11:26AM

27
#11 - Vim rocks / vimrocks

10/13/2012 at 03:27PM

27
#12 - Dan Goldstein / dggoldst

10/15/2012 at 04:52AM

27
#13 - 無ん垢の叫び / john_ababa

10/16/2012 at 04:58PM

27
#14 - James / defactojames

10/17/2012 at 08:14PM

27
#15 - h_east (トロッコ6個) / h_east

10/17/2012 at 10:06PM

27
#16 - Serge Pirotte / SergePirotte

10/24/2012 at 08:39PM

27
#17 - Miguel Sánchez / miguelsr1987

10/24/2012 at 09:02PM

27
#18 - Ricardo Mendes / locks

10/27/2012 at 03:39AM

27
#19 - Peter Anselmo / peter_anselmo

11/01/2012 at 09:24PM

27
#20 - Justin Love / wondible

11/25/2012 at 07:16PM

27
#21 - a24f0600 / a24f0600

11/28/2012 at 04:08PM

27
#22 - Édouard M'tou / DouardM

12/21/2012 at 09:59PM

27
#23 - Yann Moisan / YannMoisan

01/04/2013 at 09:50PM

27
#24 - Jon Krause / jkrause314

01/24/2016 at 10:09PM

28
#25 - ☈king / SharpsawDotOrg

10/13/2012 at 02:40AM

28
#26 - Mac Heller-Ogden / twosoul

11/10/2012 at 05:07PM

28
#27 - Felix / DoubleFelix_

02/24/2015 at 08:30AM

31
#28 - Emile Swarts / EmileSwarts

10/21/2012 at 02:21PM

31
#29 - Joonas Pihlajamaa / jokkebk

03/04/2014 at 07:52AM

33
#30 - Paul Gideon Dann / giddie

10/17/2012 at 03:00PM

34
#31 - tmr / tmr314

10/15/2012 at 12:23PM

36
#32 - Dave / zzdave13

10/27/2012 at 10:55PM

36
#33 - Einar Lielmanis / spicausis

11/07/2012 at 05:07PM

36
#34 - cj / cj01101

08/20/2013 at 05:51PM

37
#35 - Steve Tjoa / stevetjoa

02/06/2013 at 06:24AM

38
#36 - Chasetopher / chasetopherlee

04/30/2013 at 06:49AM

38
#37 - Cam Peterson / Cam_Peterson

05/02/2013 at 05:56AM

39
#38 - Rob Grijs / robgrijs

10/14/2012 at 04:19PM

41
#39 - Jesse Weaver / jessepweaver

10/19/2012 at 01:58AM

41
#40 - brett / brettyukich

09/22/2013 at 09:05PM

42
#41 - Justin / justinjaffray

04/24/2013 at 06:10PM

42
#42 - James / Dronak

09/21/2014 at 02:15AM

43
#43 - Alec Chen / alec929

11/03/2012 at 01:47PM

43
#44 - hiroaki yasutomo / kaminaly

09/04/2013 at 06:30PM

44
#45 - Glen / Glen_S

10/14/2012 at 12:36PM

44
#46 - cvp / cperepelitsa

10/29/2012 at 07:31AM

48
#47 - Danilo / dbrgn

10/29/2012 at 09:34PM

49
#48 - Julien Etienne / ix4r

10/18/2012 at 09:38PM

50
#49 - Gurukandhamoorthi / Gurukandhamoor1

08/30/2017 at 03:46PM

55
#50 - Jeremy Peterson / dunderline

10/20/2012 at 11:34PM

55
#51 - Steven Occhipinti / steveocchipinti

10/26/2012 at 04:06AM

58
#52 - Alain Gilbert / alain_gilbert

10/13/2012 at 02:16AM

67
#53 - Brandon Lee / bernardoodoo

10/24/2012 at 02:11PM