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):
40
#91 - uuu / @uu59

12/30/2010 at 01:08AM

40
#92 - Vim rocks / @vimrocks

10/07/2012 at 02:47PM

40
#93 - Steve Tjoa / @stevetjoa

08/09/2013 at 08:38PM

40
#94 - Cristian Lupașcu / @clupasq

02/21/2016 at 01:30PM

40
#95 - RockerZZY / @rocker_zzy

06/29/2020 at 02:33AM

40
#96 - TimMcGuire / @mcguire

09/01/2020 at 04:43PM

40
#97 - loupiot.veloce / @LoupiotVeloce

07/31/2022 at 04:59AM

40
#98 - FeAx / @_FeAx_

10/10/2023 at 03:06PM

40
#99 - KoroneListener / @KoroneListener

09/04/2024 at 06:55AM

41
#100 - Ben C / @cben

12/29/2010 at 06:36AM

41
#101 - Adam Pohorecki / @apohorecki

12/29/2010 at 11:25AM

41
#102 - Roland Crosby / @roooooland

12/30/2010 at 08:25AM

41
#103 - Pierre / @Pihour

01/02/2011 at 04:41PM

41
#104 - Aurélien Delahaye / @alkove

01/03/2011 at 01:32AM

41
#105 - Wesley Wong / @wesleymwwong

01/30/2011 at 10:20AM

41
#106 - Ilya Strukov / @i1ey

05/02/2011 at 06:27AM

41
#107 - Øystein Walle / @oysteinwalle

07/07/2011 at 12:03AM

41
#108 - David / @dpa_92

08/02/2011 at 11:47AM

41
#109 - nicolas bo / @thevegeta

11/15/2011 at 04:35PM

41
#110 - Jyun-Fan Tsai / @fakecolor

02/17/2012 at 03:04PM

41
#111 - vansan / @VinceVansan

08/26/2012 at 06:37PM

41
#112 - cj / @cj01101

08/26/2013 at 09:51PM

41
#113 - wutwere / @wutwere

06/30/2024 at 10:24PM

42
#114 - Vitaly Kushner / @vkushner

12/29/2010 at 11:44PM

42
#115 - Behnam Esfahbod / @zwnj

12/30/2010 at 12:34PM

42
#116 - Joost / @vlabakje

02/11/2011 at 11:07PM

42
#117 - jasper110 / @jasper110

09/22/2011 at 09:52AM

42
#118 - Kubek2k / @kubek2k

02/12/2012 at 08:38PM

42
#119 - Benoit Thiell / @benoitthiell

07/19/2012 at 10:26PM

42
#120 - Arto Vuori / @dhpe

08/30/2012 at 09:26PM