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):
20
#31 - Manuel Gómez / @mgomezch

12/17/2012 at 09:59AM

20
#32 - Tesnorth / @Tesnorth

12/18/2012 at 08:20PM

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

12/08/2012 at 04:02PM

21
#34 - じょんあば / @john_ababa

12/09/2012 at 11:36AM

21
#35 - Steve Tjoa / @stevetjoa

02/03/2013 at 11:30PM

21
#36 - Kai Yuan / @kentyuan

02/21/2013 at 09:45PM

21
#37 - Satoshi Kawasaki / @hobbes3k

04/18/2013 at 05:52AM

21
#38 - RockerZZY / @rocker_zzy

06/06/2020 at 02:44AM

22
#39 - Chris Maguire / @chriswmaguire

12/12/2012 at 06:11PM

22
#40 - Dongwook Lee / @nephilimz

01/06/2013 at 09:19AM

22
#41 - Asmund / @herrasbe

01/11/2013 at 08:48PM

22
#42 - curist / @curist

07/09/2013 at 10:05AM

22
#43 - cj / @cj01101

08/20/2013 at 10:49PM

22
#44 - Ram Tamtam / @ramtamtamtam

07/02/2014 at 02:26PM

22
#45 - shahanavaz m / @shahanavazm

04/13/2024 at 04:46AM

23
#46 - adi li / @guessimtoolate

12/08/2012 at 11:28PM

23
#47 - brett / @brettyukich

09/22/2013 at 09:52PM

23
#48 - Yann / @yannstad

03/02/2017 at 11:03PM

23
#49 - Olivier Bégassat / @zk_evm

06/15/2023 at 08:16PM

24
#50 - Hubba / @HubbaBubbaFett

12/08/2012 at 03:47PM

24
#51 - Mac Heller-Ogden / @twosoul

12/08/2012 at 11:32PM

24
#52 - Alex Shapovalov / @shapov

12/14/2012 at 03:52AM

24
#53 - nozakikohei / @taki_4416

12/14/2012 at 06:05AM

24
#54 - CY / @wongcy0

01/27/2013 at 09:29AM

24
#55 - Bailey Ling / @blingcoder

03/09/2013 at 04:25AM

24
#56 - Joshua Draper / @JoshuaBDraper

05/25/2013 at 10:08PM

24
#57 - Aaron Bieber / @aaronbieber

06/02/2013 at 11:09PM

24
#58 - Ryan Marcotte / @ryanjmarcotte

11/11/2015 at 12:19AM

24
#59 - James Marshall / @astrophd

10/23/2022 at 02:30AM

24
#60 - James / @Dronak

10/23/2022 at 03:53AM