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):
44
#121 - Matthew Draper / @_matthewd

12/29/2010 at 12:19PM

44
#122 - Xelrifos / @Xelrifos

02/25/2014 at 07:41PM

44
#123 - Chris G / @AboutThatThing

06/10/2019 at 03:26PM

45
#124 - johnny / @johnnychm

12/29/2010 at 11:40AM

45
#125 - Noah / @NoahJ32

12/29/2010 at 12:57PM

45
#126 - Mariano Guerra / @marianoguerra

12/29/2010 at 01:45PM

45
#127 - Toto l'haricot / @nico_le_terribl

01/09/2011 at 10:34PM

45
#128 - Christopher Brew / @Seph1rothVII

02/01/2012 at 12:12AM

45
#129 - ajh / @AlexJHammel

12/23/2012 at 07:36PM

45
#130 - Adam G / @gougerz

07/04/2014 at 08:21PM

45
#131 - James / @Dronak

09/21/2014 at 02:38AM

46
#132 - Paul Heideman / @paulheideman

12/29/2010 at 02:02PM

46
#133 - Drew Neil / @nelstrom

12/29/2010 at 05:02PM

46
#134 - Ben Lenarts / @benlenarts

12/29/2010 at 06:34PM

46
#135 - Rasmus P / @rasmup

12/29/2010 at 06:44PM

46
#136 - Thom Hughes / @thom_hughes_1

03/29/2011 at 03:33AM

46
#137 - David Xia / @davidxia_

03/24/2012 at 01:52AM

46
#138 - Fake Name / @The_Real_User

01/18/2014 at 01:18AM

46
#139 - Justin Knag / @justinknag

10/14/2014 at 05:55AM

46
#140 - Michael Gerdes / @mgerdes11

03/02/2015 at 08:41PM

47
#141 - dagbrown / @dagbrown

12/29/2010 at 07:06AM

47
#142 - Tordek / @Tordek

12/29/2010 at 08:50AM

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

12/29/2010 at 04:19PM

47
#144 - Dmytro Shteflyuk / @kpumuk

12/29/2010 at 04:42PM

47
#145 - Tom Cammann / @tea_sea

11/15/2012 at 10:55AM

47
#146 - Sam Burk / @smwbk

12/21/2013 at 03:05AM

47
#147 - Gerald Tilma / @GeraldTilma

11/01/2015 at 03:27AM

47
#148 - Gurukandhamoorthi / @Gurukandhamoor1

08/02/2017 at 04:25PM

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

06/27/2019 at 10:39PM

48
#150 - libicocco / @libicocco

12/29/2010 at 12:33PM