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

238 active golfers, 622 entries

Leaderboard (lowest score wins):
46
#151 - Drew Neil / @nelstrom

12/29/2010 at 05:02PM

46
#152 - Ben Lenarts / @benlenarts

12/29/2010 at 06:34PM

46
#153 - Rasmus P / @rasmup

12/29/2010 at 06:44PM

46
#154 - Thom Hughes / @thom_hughes_1

03/29/2011 at 03:33AM

46
#155 - David Xia / @davidxia_

03/24/2012 at 01:52AM

46
#156 - Fake Name / @The_Real_User

01/18/2014 at 01:18AM

46
#157 - Justin Knag / @justinknag

10/14/2014 at 05:55AM

46
#158 - Michael Gerdes / @mgerdes11

03/02/2015 at 08:41PM

47
#159 - dagbrown / @dagbrown

12/29/2010 at 07:06AM

47
#160 - Tordek / @Tordek

12/29/2010 at 08:50AM

47
#161 - Dezső Zoltán / @zakiazigazi

12/29/2010 at 04:19PM

47
#162 - Dmytro Shteflyuk / @kpumuk

12/29/2010 at 04:42PM

47
#163 - T / @tea_sea

11/15/2012 at 10:55AM

47
#164 - Sam Burk / @smwbk

12/21/2013 at 03:05AM

47
#165 - Gerald Tilma / @GeraldTilma

11/01/2015 at 03:27AM

47
#166 - Gurukandhamoorthi / @Gurukandhamoor1

08/02/2017 at 04:25PM

47
#167 - Sigurður Ægir Jónsso / @siggiae

06/27/2019 at 10:39PM

48
#168 - libicocco / @libicocco

12/29/2010 at 12:33PM

48
#169 - Gautier / @Gowtier

12/29/2010 at 12:49PM

48
#170 - solsTiCe d'Hiver / @solstice_dhiver

12/30/2010 at 05:44PM

48
#171 - Jordan Wightman / @tuo2

01/06/2011 at 06:04AM

48
#172 - snuffling / @snuffling

02/13/2012 at 05:54AM

48
#173 - annagrammatica1 / @annagrammatica1

09/12/2012 at 03:05AM

48
#174 - Daniel / @Daniel00288663

04/04/2017 at 08:53AM

49
#175 - Alex Bartol / @alexbartol

05/06/2015 at 06:35AM

50
#176 - Corbin Simpson / @corbinsimpson

12/29/2010 at 07:19AM

50
#177 - ehc / @ehc

12/29/2010 at 08:11AM

50
#178 - Fer Enaf / @0x00C0FFEE

12/29/2010 at 11:05AM

50
#179 - Brad / @bjjwillis

12/29/2010 at 09:27PM

50
#180 - drio / @drio

01/02/2011 at 01:46PM