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):
14
#1 - Urtica dioica / @udioica

12/08/2012 at 06:57AM

14
#2 - Marcin Szamotulski / @me_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

14
#14 - Jon Krause / @jkrause314

12/20/2020 at 05:59AM

14
#15 - Janzen / @__Coos

09/28/2022 at 11:53AM

14
#16 - Peppa Pig / @PeppaPigSg

06/29/2024 at 10:28AM

14
#17 - nickGPT / @nickandbro

08/28/2024 at 07:10PM

15
#18 - Kajetan Bojko / @KajetanBojko

12/22/2012 at 06:27PM

15
#19 - Michel Viktor / @tomkpz

07/29/2021 at 02:05AM

16
#20 - Kerson Hsiao / @KersonHsiao

12/11/2012 at 07:30AM

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

12/23/2012 at 05:00PM

17
#22 - Tyler / @tylerbindon

04/03/2013 at 02:42AM

17
#23 - x03n046 / @x03n046

05/16/2022 at 12:52AM

19
#24 - a24f0600 / @a24f0600

12/11/2012 at 03:13PM

19
#25 - Lieven Keersmaekers / @LievenKeersmaek

12/15/2012 at 03:01PM

19
#26 - 张文远 / @zhwenyuan

05/25/2013 at 11:50AM

19
#27 - US Dollar Price / @USDollarPrice

11/06/2013 at 08:08AM

19
#28 - thasso / @thasso23

11/17/2013 at 12:18PM

19
#29 - Hannes Remahl / @hannesr

02/28/2014 at 11:25AM

19
#30 - Joonas Pihlajamaa / @jokkebk

03/15/2014 at 11:14AM