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

217 active golfers, 547 entries

Leaderboard (lowest score wins):
36
#61 - Mattiassich Ákos / @mattiassicha

01/07/2011 at 12:04PM

36
#62 - Jim Infield / @jinfield

07/20/2011 at 04:37AM

36
#63 - pikaren / @REALpikaren

01/21/2014 at 04:31AM

37
#64 - Takayuki Tsukitani / @tsukkee

12/30/2010 at 06:08AM

37
#65 - Francisco Dibar / @frandibar

01/13/2011 at 05:23AM

37
#66 - mightyfoo / @mightyfoo

05/26/2011 at 02:27AM

37
#67 - brett / @brettyukich

09/22/2013 at 10:23PM

38
#68 - Josh Weinberg / @jcweinberg

12/30/2010 at 04:13AM

38
#69 - 無ん垢の叫び / @john_ababa

02/23/2012 at 08:23AM

38
#70 - r. / @rmarvie

12/20/2014 at 10:19PM

39
#71 - foo bar / @whoever_foo

12/29/2010 at 10:40AM

39
#72 - Skirmantas / @coderiz

12/29/2010 at 10:50PM

39
#73 - Pete Johns / @johnsyweb

01/15/2011 at 03:25AM

39
#74 - xhtmlforum / @xhtmlforum

02/01/2011 at 10:04PM

39
#75 - Eivind Jahren / @HaskellElephant

02/12/2011 at 12:50PM

39
#76 - Rolf K. / @mindleftbody

06/17/2011 at 01:45PM

39
#77 - chris nojima / @chrisnojima

02/02/2012 at 07:38PM

39
#78 - Marcin Szamotulski / @me_coot

11/24/2012 at 05:32PM

39
#79 - Mauro Persano / @fzort

11/20/2014 at 07:04PM

39
#80 - churaki / @churaki

01/26/2019 at 10:46AM

40
#81 - sirex / @sirex

12/29/2010 at 12:55PM

40
#82 - uuu / @uu59

12/30/2010 at 01:08AM

40
#83 - Vim rocks / @vimrocks

10/07/2012 at 02:47PM

40
#84 - Steve Tjoa / @stevetjoa

08/09/2013 at 08:38PM

40
#85 - Cristian Lupașcu / @clupasq

02/21/2016 at 01:30PM

40
#86 - RockerZZY / @rocker_zzy

06/29/2020 at 02:33AM

40
#87 - TimMcGuire / @mcguire

09/01/2020 at 04:43PM

41
#88 - Ben C / @cben

12/29/2010 at 06:36AM

41
#89 - Adam Pohorecki / @apohorecki

12/29/2010 at 11:25AM

41
#90 - Roland Crosby / @roooooland

12/30/2010 at 08:25AM