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 4d1ace6c142cca7133000033

Reformat some Python

Fix some very bizarrely laid-out code.

Start file
def fed(j):
    n = sum([1000000000,
              200000000,
               30000000,
                4000000,
                 500000,
                  60000,
                   7000,
                    800,
                     90,
                     j])
    print('abc'+str(n)+'def')
End file
def fed(j):
    n = 1234567890 + j
    print('abc%ddef' % n)

View Diff

2,12c2,3
<     n = sum([1000000000,
<               200000000,
<                30000000,
<                 4000000,
<                  500000,
<                   60000,
<                    7000,
<                     800,
<                      90,
<                      j])
<     print('abc'+str(n)+'def')
---
>     n = 1234567890 + j
>     print('abc%ddef' % n)

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 234 remaining solutions by signing in and submitting your own entry
#235 Irfan Ahmad / @erfaan - Score: 299 - 12/29/10 @ 14:10
<Down><Down>dddddddddddddddd<Right>i<Del><Del><Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><BS><BS><BS><BS><Right><Del>234567890<Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del> <kPlus><Del><Right><Right><Down><Home><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Left><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del>%d<Right><Right><Right><Right> % n<Esc>:wq<CR>

0 comments


Created by: @holizz

235 active golfers, 604 entries

Leaderboard (lowest score wins):
43
#121 - clint tseng / @cxlt

12/29/2010 at 06:21AM

43
#122 - Kenny Parnell / @kennyp

12/29/2010 at 07:52AM

43
#123 - John Lam / @john_lam

12/29/2010 at 09:18AM

43
#124 - pcapriotti / @pcapriotti

12/29/2010 at 11:23AM

43
#125 - Utkarsh Kukreti / @utkarshkukreti

12/29/2010 at 11:32AM

43
#126 - Addisu Taddese / @azeey

12/30/2010 at 07:04AM

43
#127 - Aviv Ben-Yosef / @avivby

12/30/2010 at 07:41AM

43
#128 - vTsoumenis / @kioopi

01/02/2011 at 04:54PM

43
#129 - Ashley Feniello / @AshleyFen

01/29/2012 at 05:58AM

43
#130 - Oliver Christ / @0liverChrist

10/05/2013 at 10:10PM

43
#131 - Walker Boh / @walker_boh

11/19/2015 at 08:29AM

43
#132 - shahanavaz m / @shahanavazm

01/27/2024 at 02:48AM

44
#133 - Andrew Scala / @agscala

12/29/2010 at 06:13AM

44
#134 - Naveed Massjouni / @ironcamel

12/29/2010 at 06:40AM

44
#135 - Matthew Draper / @_matthewd

12/29/2010 at 12:19PM

44
#136 - Xelrifos / @Xelrifos

02/25/2014 at 07:41PM

44
#137 - Chris G / @AboutThatThing

06/10/2019 at 03:26PM

45
#138 - johnny / @johnnychm

12/29/2010 at 11:40AM

45
#139 - Noah / @NoahJ32

12/29/2010 at 12:57PM

45
#140 - Mariano Guerra / @marianoguerra

12/29/2010 at 01:45PM

45
#141 - Toto l'haricot / @nico_le_terribl

01/09/2011 at 10:34PM

45
#142 - Christopher Brew / @Seph1rothVII

02/01/2012 at 12:12AM

45
#143 - ajh / @AlexJHammel

12/23/2012 at 07:36PM

45
#144 - Adam G / @gougerz

07/04/2014 at 08:21PM

45
#145 - James / @Dronak

09/21/2014 at 02:38AM

45
#146 - Joe Farnsworth / @JoeFarnsworth

06/22/2021 at 02:12PM

46
#147 - Paul Heideman / @paulheideman

12/29/2010 at 02:02PM

46
#148 - Drew Neil / @nelstrom

12/29/2010 at 05:02PM

46
#149 - Ben Lenarts / @benlenarts

12/29/2010 at 06:34PM

46
#150 - Rasmus P / @rasmup

12/29/2010 at 06:44PM