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):
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

34
#39 - じょり / @jyori112

06/03/2021 at 03:23PM

34
#40 - Salvador Tojo Quintela / @SalvadorTojo

10/12/2021 at 01:52PM

34
#41 - Qing Liu / @poeminlash

07/20/2022 at 05:29AM

34
#42 - Zion Park / @zionpark93

01/09/2023 at 02:41AM

34
#43 - Peppa Pig / @PeppaPigSg

06/01/2024 at 04:06PM

34
#44 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

34
#45 - Brando / @brandonce

01/27/2025 at 09:47AM

34
#46 - Sergii Pidgornyi / @spodgorn

02/14/2025 at 03:52PM

35
#47 - Indrek Juhkam / @indrekj

12/29/2010 at 04:35PM

35
#48 - kana / @kana1

12/29/2010 at 04:44PM

35
#49 - Ed Singleton / @Singletoned

12/30/2010 at 02:53PM

35
#50 - Steve Morrow / @yawmark

01/27/2011 at 12:08AM

35
#51 - William Dunand / @wdunand

12/02/2011 at 09:20AM

35
#52 - Xavier Nayrac / @lkdjiin

12/30/2011 at 09:16AM

35
#53 - veki / @vx_ras

02/03/2012 at 12:52AM

35
#54 - tmr / @tmr314

09/08/2012 at 06:25PM

35
#55 - a24f0600 / @a24f0600

01/09/2013 at 08:28AM

35
#56 - xavier kt / @xav_kt

02/05/2013 at 12:39AM

35
#57 - Tyler / @tylerbindon

03/31/2013 at 09:27PM

35
#58 - Joonas Pihlajamaa / @jokkebk

02/20/2014 at 03:33PM

35
#59 - Ram Tamtam / @ramtamtamtam

07/02/2014 at 10:55AM

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

08/02/2014 at 08:12AM