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

221 active golfers, 554 entries

Leaderboard (lowest score wins):
85
#211 - Gordy F / @gordyf

12/29/2010 at 06:48AM

90
#212 - Guillaume Bonnoron / @gbonnoron

12/31/2010 at 11:42AM

98
#213 - Mohammad Mithani / @mtmithani

12/23/2013 at 03:07AM

104
#214 - Charles Maresh / @CMaresh

12/29/2010 at 02:58PM

106
#215 - Christian Stefanescu / @0_chris

12/29/2010 at 06:29AM

106
#216 - theshadowhost / @theshadowhost

12/29/2010 at 01:32PM

108
#217 - nat / @natblue55

01/02/2011 at 12:55AM

110
#218 - Benjaminister / @Benjaminister

12/29/2010 at 08:10AM

112
#219 - Andy Chong / @andycjw

12/30/2010 at 03:34AM

138
#220 - Austin Agent Finder / @AtxAgents

06/25/2021 at 03:14PM

299
#221 - Irfan Ahmad / @erfaan

12/29/2010 at 02:10PM