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

75 active golfers, 210 entries

Leaderboard (lowest score wins):
25
#61 - mhb / @mhbvim

12/08/2012 at 06:03AM

25
#62 - うえっち / @uh_tomo

12/13/2012 at 06:17PM

25
#63 - マーロウ / @PhilllipMarlowe

03/27/2013 at 05:32AM

25
#64 - ltn614 / @ltn614

10/09/2015 at 03:23AM

25
#65 - Ben Hill / @KaizenSoze70

06/20/2016 at 12:32PM

26
#66 - jk / @kewnapse

12/23/2012 at 12:33AM

26
#67 - Robert Goeddel / @f0rdpr3fect

11/11/2015 at 12:16AM

28
#68 - Oliver Christ / @0liverChrist

10/05/2013 at 09:56PM

32
#69 - Cristian Lupașcu / @clupasq

04/15/2016 at 08:21PM

35
#70 - Runar / @runarfu

12/08/2012 at 09:56AM

38
#71 - Devin Christensen / @quixoten

12/13/2012 at 11:12PM

47
#72 - pfl / @pfl22

12/08/2012 at 01:23PM

51
#73 - Russ Adams / @rustushki

12/11/2012 at 01:34AM

52
#74 - Pradeep Kumar 🇮🇳🇮🇳🇮🇳🇮🇱🇮🇱🇮🇱 / @pradeep6kumar

12/11/2012 at 05:26AM

484
#75 - Django Janny / @keltroth

12/08/2012 at 02:37PM