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 50c2c246b0544c000200003f

Block Fun 1

Manipulate the columns to produce desired result.

Start file
01234567890123456789012345678901234567890123456789012345678901234567890123456789
1                                                                              0
2                                                                              1
3                                                                              2
4                                                                              3
5                                                                              4
6                                                                              5
7                                                                              6
8                                                                              7
9                                                                              8
01234567890123456789012345678901234567890123456789012345678901234567890123456789
End file
01234567890123456789012345678901234567890123456789012345678901234567890123456789
1        0         0         0         0         0         0         0         0
2        1         1         1         1         1         1         1         1
3        2         2         2         2         2         2         2         2
4        3         3         3         3         3         3         3         3
5        4         4         4         4         4         4         4         4
6        5         5         5         5         5         5         5         5
7        6         6         6         6         6         6         6         6
8        7         7         7         7         7         7         7         7
9        8         8         8         8         8         8         8         8
01234567890123456789012345678901234567890123456789012345678901234567890123456789

View Diff

2,10c2,10
< 1                                                                              0
< 2                                                                              1
< 3                                                                              2
< 4                                                                              3
< 5                                                                              4
< 6                                                                              5
< 7                                                                              6
< 8                                                                              7
< 9                                                                              8
---
> 1        0         0         0         0         0         0         0         0
> 2        1         1         1         1         1         1         1         1
> 3        2         2         2         2         2         2         2         2
> 4        3         3         3         3         3         3         3         3
> 5        4         4         4         4         4         4         4         4
> 6        5         5         5         5         5         5         5         5
> 7        6         6         6         6         6         6         6         6
> 8        7         7         7         7         7         7         7         7
> 9        8         8         8         8         8         8         8         8

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 64 remaining solutions by signing in and submitting your own entry
#65 Django Janny / @keltroth - Score: 484 - 12/08/12 @ 14:37
:%s/[0-9<BS><BS><BS>1_<BS>-9]<Left><Left><Left><Left><Left>^<Right><Right><Right><Right><Right><Right><Left><Left><Left><Left><Left>\(<Right><Right><Right><Right><Right>\)/\1        1<BS>0<BS><BS><BS><BS><BS><BS><BS><BS><BS>        submatch(1 <BS>) + 1)<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>(<End>/g<CR><Esc>u:<Up><Left><Left><Left><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>)<Left>\1+1<CR><Esc>u:<Up><Left><Left><Left><Left><Left><Left>{<Right><Right><Right>}<Left><Left><BS>-<CR>:<Up><Down>u:<BS><CR>:<Up><Up><Left><Left><Left><BS><Left><Left><Left><BS><Right><Right><Right><Left><Left><Left><Left><Left><Right><BS><Right><Right><Right><Right><Right><BS><CR><Esc>u<Up><Down>:<Up><Home><Right><Right><Right><Del><Right><Right><Right><Right><Right><Right><Right><Right><Right>$<Right><Right><Left><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Del><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>^\(\).*<Left><Left><Left><Left>[0-9]<CR><Esc>u:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Del> <CR><Esc>u:1<CR>:<Up><Up><Home><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Left><Left><Left><Left><Left><Del>1<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Del>0<Right><Right><Left><Del>8<Right><CR><Esc>u:<Up><Left><Left><Left><Right>\1        \2         \2<CR>u:<Up><Left><Left><Left><Left><BS><BS><BS><BS><BS><BS><BS><BS><BS><C-V><Tab><Left><Left><Left><BS><BS><BS><BS><BS><BS><BS><BS><C-V><Tab><Esc>:<BS>:<Up><CR>u:<Up><Up><Left><Left>         \2         \2         \2         \2         \2         \2<CR><CR><Esc>:w<CR>:q<CR>

0 comments


Created by: @DiffJunk

65 active golfers, 158 entries

Leaderboard (lowest score wins):
14
#1 - Urtica dioica / @udioica

12/08/2012 at 06:57AM

14
#2 - Marcin Sza / @coot_

12/08/2012 at 10:22AM

14
#3 - Conner McDaniel / @connermcd

12/08/2012 at 10:56PM

14
#4 - Ray Lehtiniemi / @rayll

12/09/2012 at 06:39PM

14
#5 - Alec Goebel / @zego5360

01/04/2013 at 08:12AM

14
#6 - Yi EungJun / @semtlnori

01/04/2013 at 04:47PM

14
#7 - Petro Тrouq / @zulolosi

02/20/2013 at 08:18PM

14
#8 - Julius Pfrommer / @dlctr

03/03/2013 at 09:26AM

14
#9 - Trevor Powell / @DoomedBunnies

04/11/2013 at 02:22AM

14
#10 - Marco Hinz / @_mhinz_

05/26/2013 at 04:08PM

14
#11 - Bradd Szonye / @bszonye

07/15/2013 at 03:19AM

14
#12 - John Braxler / @braxler

05/18/2014 at 06:42PM

14
#13 - pftb12345 / @pftb12345

04/22/2015 at 05:31AM

15
#14 - Kajetan Bojko / @KajetanBojko

12/22/2012 at 06:27PM

16
#15 - Kerson Hsiao / @KersonHsiao

12/11/2012 at 07:30AM

17
#16 - h_east (トロッコ6個) / @h_east

12/23/2012 at 05:00PM

17
#17 - Tyler / @tylerbindon

04/03/2013 at 02:42AM

19
#18 - a24f0600 / @a24f0600

12/11/2012 at 03:13PM

19
#19 - Lieven Keersmaekers / @LievenKeersmaek

12/15/2012 at 03:01PM

19
#20 - wushexu / @wushexu

05/25/2013 at 11:50AM

19
#21 - US Dollar Price / @USDollarPrice

11/06/2013 at 08:08AM

19
#22 - thasso / @thasso23

11/17/2013 at 12:18PM

19
#23 - Hannes Remahl / @hannesr

02/28/2014 at 11:25AM

19
#24 - Joonas Pihlajamaa / @jokkebk

03/15/2014 at 11:14AM

20
#25 - Manuel Gómez / @mgomezch

12/17/2012 at 09:59AM

20
#26 - Tesnorth / @Tesnorth

12/18/2012 at 08:20PM

21
#27 - Adelar S. Queiróz / @adelarsq

12/08/2012 at 04:02PM

21
#28 - 無ん垢の叫び / @john_ababa

12/09/2012 at 11:36AM

21
#29 - Steve Tjoa / @stevetjoa

02/03/2013 at 11:30PM

21
#30 - Kai Yuan / @kentyuan

02/21/2013 at 09:45PM