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

216 active golfers, 545 entries

Leaderboard (lowest score wins):
47
#151 - Sigurður Ægir Jónsso / @siggiae

06/27/2019 at 10:39PM

48
#152 - libicocco / @libicocco

12/29/2010 at 12:33PM

48
#153 - Gautier / @Gowtier

12/29/2010 at 12:49PM

48
#154 - solsTiCe d'Hiver / @solstice_dhiver

12/30/2010 at 05:44PM

48
#155 - Jordan Wightman / @tuo2

01/06/2011 at 06:04AM

48
#156 - snuffling / @snuffling

02/13/2012 at 05:54AM

48
#157 - annagrammatica1 / @annagrammatica1

09/12/2012 at 03:05AM

48
#158 - Daniel / @Daniel00288663

04/04/2017 at 08:53AM

49
#159 - Alex Bartol / @alexbartol

05/06/2015 at 06:35AM

50
#160 - Corbin Simpson / @corbinsimpson

12/29/2010 at 07:19AM

50
#161 - ehc / @ehc

12/29/2010 at 08:11AM

50
#162 - Fer Enaf / @0x00C0FFEE

12/29/2010 at 11:05AM

50
#163 - Brad / @bjjwillis

12/29/2010 at 09:27PM

50
#164 - drio / @drio

01/02/2011 at 01:46PM

50
#165 - Nick / @quinks25

01/13/2011 at 11:03AM

51
#166 - Mike Waldner / @mawaldne

03/26/2011 at 03:13PM

51
#167 - Dave / @zzdave13

07/31/2011 at 09:59PM

51
#168 - Timothy Hahn / @timyhahn

04/20/2012 at 03:45AM

52
#169 - Henrik Nyh / @henrik

12/29/2010 at 09:52AM

52
#170 - Duda Dornelles / @dudadornelles

01/05/2011 at 01:04PM

52
#171 - marmelad / @jordgubbssylt

11/17/2012 at 11:18AM

52
#172 - victor / @victor20145300

08/22/2020 at 02:28PM

53
#173 - Simon Brown / @caelyxsec

12/29/2010 at 06:43AM

53
#174 - Jason Wolf / @zephyr_wolf

11/08/2012 at 06:42PM

53
#175 - __VimGolfer__ / @VimGolfer19

11/27/2020 at 05:44PM

54
#176 - Alex B. / @SIGKILL

12/29/2010 at 01:48PM

54
#177 - Marian Schubert / @MarianSchubert

12/29/2010 at 01:58PM

54
#178 - Remigijus (ReekenX) / @reekenx

12/29/2010 at 04:08PM

55
#179 - Bernerd Schaefer / @bjschaefer

12/29/2010 at 09:52AM

55
#180 - Lasse Immonen / @turtleman10

12/29/2010 at 02:27PM