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):
24
#1 - Nathan / @boysetsfrog

11/07/2012 at 07:45AM

24
#2 - Peppa Pig / @PeppaPi95550250

09/13/2024 at 02:38AM

25
#3 - Victor Ramirez / @virako

10/21/2012 at 09:32PM

25
#4 - Conner McDaniel / @connermcd

10/23/2012 at 02:20PM

25
#5 - Urtica dioica / @udioica

12/12/2012 at 10:24AM

25
#6 - Marco Hinz / @_mhinz_

05/28/2013 at 01:43PM

25
#7 - Petro Тrouq / @zulolosi

06/08/2013 at 08:18AM

25
#8 - Bradd Szonye / @bszonye

07/15/2013 at 02:02AM

25
#9 - Anton Davydov / @anton_davydov

01/04/2014 at 04:38PM

25
#10 - John Braxler / @braxler

05/14/2014 at 01:57PM

25
#11 - Turkey Man / @lvturkeyman

12/18/2017 at 06:37AM

25
#12 - Jean George / @JeanGeo20504212

10/20/2023 at 11:17AM

27
#13 - Kerson Hsiao / @KersonHsiao

10/13/2012 at 11:26AM

27
#14 - Vim rocks / @vimrocks

10/13/2012 at 03:27PM

27
#15 - Dan Goldstein / @dggoldst

10/15/2012 at 04:52AM

27
#16 - じょんあば / @john_ababa

10/16/2012 at 04:58PM

27
#17 - James / @defactojames

10/17/2012 at 08:14PM

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

10/17/2012 at 10:06PM

27
#19 - Serge Pirotte / @SergePirotte

10/24/2012 at 08:39PM

27
#20 - Miguel Sánchez / @miguelsr1987

10/24/2012 at 09:02PM

27
#21 - Ricardo Mendes / @locks

10/27/2012 at 03:39AM

27
#22 - Peter Anselmo / @peter_anselmo

11/01/2012 at 09:24PM

27
#23 - Justin Love / @wondible

11/25/2012 at 07:16PM

27
#24 - a24f0600 / @a24f0600

11/28/2012 at 04:08PM

27
#25 - Édouard M'tou / @DouardM

12/21/2012 at 09:59PM

27
#26 - Yann Moisan / @YannMoisan

01/04/2013 at 09:50PM

27
#27 - Jon Krause / @jkrause314

01/24/2016 at 10:09PM

28
#28 - ☈king / @SharpsawDotOrg

10/13/2012 at 02:40AM

28
#29 - Mac Heller-Ogden / @twosoul

11/10/2012 at 05:07PM

28
#30 - Felix / @DoubleFelix_

02/24/2015 at 08:30AM