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):
67
#61 - Brandon Lee / @bernardoodoo

10/24/2012 at 02:11PM