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

61 active golfers, 204 entries

Leaderboard (lowest score wins):
31
#31 - Emile Swarts / @EmileSwarts

10/21/2012 at 02:21PM

31
#32 - Joonas Pihlajamaa / @jokkebk

03/04/2014 at 07:52AM

33
#33 - Paul Gideon Dann / @giddie

10/17/2012 at 03:00PM

33
#34 - POSIX / @po6ix

01/24/2022 at 01:56PM

34
#35 - tmr / @tmr314

10/15/2012 at 12:23PM

36
#36 - Dave / @zzdave13

10/27/2012 at 10:55PM

36
#37 - Einar Lielmanis / @spicausis

11/07/2012 at 05:07PM

36
#38 - cj / @cj01101

08/20/2013 at 05:51PM

37
#39 - Steve Tjoa / @stevetjoa

02/06/2013 at 06:24AM

37
#40 - Miłosz Łakomy / @foobar01123

09/10/2021 at 07:48AM

37
#41 - Qing Liu / @poeminlash

10/17/2022 at 02:23AM

38
#42 - Chasetopher / @chasetopherlee

04/30/2013 at 06:49AM

38
#43 - Cam Peterson / @Cam_Peterson

05/02/2013 at 05:56AM

39
#44 - Rob Grijs / @robgrijs

10/14/2012 at 04:19PM

41
#45 - Jesse Weaver / @jessepweaver

10/19/2012 at 01:58AM

41
#46 - brett / @brettyukich

09/22/2013 at 09:05PM

42
#47 - Justin / @justinjaffray

04/24/2013 at 06:10PM

42
#48 - James / @Dronak

09/21/2014 at 02:15AM

43
#49 - Alec Chen / @alec929

11/03/2012 at 01:47PM

43
#50 - hiroaki yasutomo / @kaminaly

09/04/2013 at 06:30PM

44
#51 - Glen / @Glen_S

10/14/2012 at 12:36PM

44
#52 - cvp / @cperepelitsa

10/29/2012 at 07:31AM

48
#53 - Danilo / @dbrgn

10/29/2012 at 09:34PM

49
#54 - Julien Etienne / @ix4r

10/18/2012 at 09:38PM

50
#55 - Gurukandhamoorthi / @Gurukandhamoor1

08/30/2017 at 03:46PM

50
#56 - nickGPT / @nickandbro

08/28/2024 at 07:33PM

55
#57 - Jeremy Peterson / @dunderline

10/20/2012 at 11:34PM

55
#58 - Steven Occhipinti / @steveocchipinti

10/26/2012 at 04:06AM

57
#59 - shahanavaz m / @shahanavazm

04/02/2024 at 03:46AM

58
#60 - Alain Gilbert / @alain_gilbert

10/13/2012 at 02:16AM