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

213 active golfers, 528 entries

Leaderboard (lowest score wins):
34
#31 - pftb12345 / @pftb12345

04/14/2015 at 01:49PM

34
#32 - Jon Krause / @jkrause314

12/29/2015 at 06:23AM

34
#33 - Will / @obiwan__k3n00bi

08/25/2016 at 06:19AM

34
#34 - Turkey Man / @lvturkeyman

11/26/2017 at 05:08PM

34
#35 - DHM / @DHM29978992

05/03/2018 at 01:36AM

34
#36 - Mihai / @mihaicristiant

02/28/2019 at 07:27AM

34
#37 - Lory / @Lory46845742

12/13/2019 at 02:04PM

34
#38 - Miłosz Łakomy / @foobar01123

04/07/2020 at 04:24AM

35
#39 - Indrek Juhkam / @indrekj

12/29/2010 at 04:35PM

35
#40 - kana / @kana1

12/29/2010 at 04:44PM

35
#41 - Ed Singleton / @Singletoned

12/30/2010 at 02:53PM

35
#42 - Steve Morrow / @yawmark

01/27/2011 at 12:08AM

35
#43 - William Dunand / @wdunand

12/02/2011 at 09:20AM

35
#44 - Xavier Nayrac / @lkdjiin

12/30/2011 at 09:16AM

35
#45 - veki / @vx_ras

02/03/2012 at 12:52AM

35
#46 - tmr / @tmr314

09/08/2012 at 06:25PM

35
#47 - a24f0600 / @a24f0600

01/09/2013 at 08:28AM

35
#48 - xavier kt / @xav_kt

02/05/2013 at 12:39AM

35
#49 - Tyler / @tylerbindon

03/31/2013 at 09:27PM

35
#50 - Joonas Pihlajamaa / @jokkebk

02/20/2014 at 03:33PM

35
#51 - Ram Tamtam / @ramtamtamtam

07/02/2014 at 10:55AM

35
#52 - かしゅーなっつ@修行中 / @kashew_nuts

08/02/2014 at 08:12AM

35
#53 - LC / @leeren

08/10/2014 at 07:59PM

35
#54 - 20speedvegan / @ashkevinm

04/13/2017 at 02:52PM

35
#55 - c0llision / @sh3llcode

01/28/2018 at 12:56PM

36
#56 - Leonard Chin / @lchin

12/29/2010 at 01:41PM

36
#57 - Josh Triplett / @josh_triplett

12/29/2010 at 02:24PM

36
#58 - eban / @eban

12/29/2010 at 04:22PM

36
#59 - Mattiassich Ákos / @mattiassicha

01/07/2011 at 12:04PM

36
#60 - Jim Infield / @jinfield

07/20/2011 at 04:37AM