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):
35
#61 - LC / @leeren

08/10/2014 at 07:59PM

35
#62 - 20speedvegan / @ashkevinm

04/13/2017 at 02:52PM

35
#63 - c0llision / @sh3llcode

01/28/2018 at 12:56PM

35
#64 - Brendan Schaenzer / @bschaenzer

09/30/2020 at 05:18PM

35
#65 - Jean George / @JeanGeo20504212

04/13/2022 at 06:13AM

35
#66 - bounce114 / @bounce114

12/03/2024 at 06:51AM

36
#67 - Leonard Chin / @lchin

12/29/2010 at 01:41PM

36
#68 - Josh Triplett / @josh_triplett

12/29/2010 at 02:24PM

36
#69 - eban / @eban

12/29/2010 at 04:22PM

36
#70 - Mattiassich Ákos / @mattiassicha

01/07/2011 at 12:04PM

36
#71 - Jim Infield / @jinfield

07/20/2011 at 04:37AM

36
#72 - pikaren / @REALpikaren

01/21/2014 at 04:31AM

37
#73 - Takayuki Tsukitani / @tsukkee

12/30/2010 at 06:08AM

37
#74 - Francisco Dibar / @frandibar

01/13/2011 at 05:23AM

37
#75 - mightyfoo / @mightyfoo

05/26/2011 at 02:27AM

37
#76 - brett / @brettyukich

09/22/2013 at 10:23PM

38
#77 - Josh Weinberg / @jcweinberg

12/30/2010 at 04:13AM

38
#78 - じょんあば / @john_ababa

02/23/2012 at 08:23AM

38
#79 - r. / @rmarvie

12/20/2014 at 10:19PM

39
#80 - foo bar / @whoever_foo

12/29/2010 at 10:40AM

39
#81 - Skirmantas / @coderiz

12/29/2010 at 10:50PM

39
#82 - Pete Johns / @johnsyweb

01/15/2011 at 03:25AM

39
#83 - xhtmlforum / @xhtmlforum

02/01/2011 at 10:04PM

39
#84 - Eivind Jahren / @HaskellElephant

02/12/2011 at 12:50PM

39
#85 - Rolf K. / @mindleftbody

06/17/2011 at 01:45PM

39
#86 - chris nojima / @chrisnojima

02/02/2012 at 07:38PM

39
#87 - Marcin Szamotulski / @me_coot

11/24/2012 at 05:32PM

39
#88 - Mauro Persano / @fzort

11/20/2014 at 07:04PM

39
#89 - churaki / @churaki

01/26/2019 at 10:46AM

40
#90 - sirex / @sirex

12/29/2010 at 12:55PM