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 53 remaining solutions by signing in and submitting your own entry
#54 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

54 active golfers, 188 entries

Leaderboard (lowest score wins):
33
#31 - Paul Gideon Dann / @giddie

10/17/2012 at 03:00PM

34
#32 - tmr / @tmr314

10/15/2012 at 12:23PM

36
#33 - Dave / @zzdave13

10/27/2012 at 10:55PM

36
#34 - Einar Lielmanis / @spicausis

11/07/2012 at 05:07PM

36
#35 - cj / @cj01101

08/20/2013 at 05:51PM

37
#36 - Steve Tjoa / @stevetjoa

02/06/2013 at 06:24AM

38
#37 - Chasetopher / @chasetopherlee

04/30/2013 at 06:49AM

38
#38 - Cam Peterson / @Cam_Peterson

05/02/2013 at 05:56AM

39
#39 - Rob Grijs / @robgrijs

10/14/2012 at 04:19PM

41
#40 - Jesse Weaver / @jessepweaver

10/19/2012 at 01:58AM

41
#41 - brett / @brettyukich

09/22/2013 at 09:05PM

42
#42 - Justin / @justinjaffray

04/24/2013 at 06:10PM

42
#43 - James / @Dronak

09/21/2014 at 02:15AM

43
#44 - Alec Chen / @alec929

11/03/2012 at 01:47PM

43
#45 - hiroaki yasutomo / @kaminaly

09/04/2013 at 06:30PM

44
#46 - Glen / @Glen_S

10/14/2012 at 12:36PM

44
#47 - cvp / @cperepelitsa

10/29/2012 at 07:31AM

48
#48 - Danilo / @dbrgn

10/29/2012 at 09:34PM

49
#49 - Julien Etienne / @ix4r

10/18/2012 at 09:38PM

50
#50 - Gurukandhamoorthi / @Gurukandhamoor1

08/30/2017 at 03:46PM

55
#51 - Jeremy Peterson / @dunderline

10/20/2012 at 11:34PM

55
#52 - Steven Occhipinti / @steveocchipinti

10/26/2012 at 04:06AM

58
#53 - Alain Gilbert / @alain_gilbert

10/13/2012 at 02:16AM

67
#54 - Brandon Lee / @bernardoodoo

10/24/2012 at 02:11PM