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):
63
#211 - Michael Lustfield / @Profarius

12/29/2010 at 06:25AM

63
#212 - Paul Tarjan / @ptarjan

12/29/2010 at 11:48AM

64
#213 - Jan B. / @bracki

12/29/2010 at 09:13AM

65
#214 - Geoffrey Bachelet / @ubermuda

12/29/2010 at 08:57AM

65
#215 - Arania Jain / @AraniaJain

12/29/2010 at 09:30AM

65
#216 - Alexey Komissarouk / @alexeymk

12/29/2010 at 01:26PM

65
#217 - smokey42 / @smokey42

12/29/2010 at 02:41PM

66
#218 - ColdBear / @ColdBear11

12/10/2022 at 06:32AM

68
#219 - Solomon White / @rubysolo

12/29/2010 at 05:39PM

69
#220 - Thanassis Tsiodras / @ttsiodras

01/03/2011 at 06:20PM

72
#221 - Rob Howard / @damncabbage

12/29/2010 at 11:11AM

73
#222 - Fraxtil / @Fraxtil

12/29/2010 at 07:30AM

73
#223 - Dhruva Sagar / @dhruvasagar

12/29/2010 at 08:30AM

74
#224 - Jonathan Pui / @jpui

12/29/2010 at 08:11AM

74
#225 - Chris Flynn / @flynnguy

12/29/2010 at 03:55PM

75
#226 - Sushant / @sushftw

12/29/2010 at 12:51PM

83
#227 - Ben Dowling / @coderholic

12/31/2010 at 05:13PM

85
#228 - Gordy F / @gordyf

12/29/2010 at 06:48AM

90
#229 - Guillaume Bonnoron / @gbonnoron

12/31/2010 at 11:42AM

98
#230 - Mohammad Mithani / @mtmithani

12/23/2013 at 03:07AM

104
#231 - Charles Maresh / @CMaresh

12/29/2010 at 02:58PM

106
#232 - Christian Stefanescu / @0_chris

12/29/2010 at 06:29AM

106
#233 - theshadowhost / @theshadowhost

12/29/2010 at 01:32PM

108
#234 - nat / @natblue55

01/02/2011 at 12:55AM

110
#235 - Benjaminister / @Benjaminister

12/29/2010 at 08:10AM

112
#236 - Andy Chong / @andycjw

12/30/2010 at 03:34AM

138
#237 - Austin Agent Finder / @AtxAgents

06/25/2021 at 03:14PM

299
#238 - Irfan Ahmad / @erfaan

12/29/2010 at 02:10PM