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 5039216a1eb07a0002000026

Sierpinski's Triangle

Build the famous fractal, Sierpinski's Triangle.

Start file
 ^
/_\ 
End file
                               ^
                              /_\
                             ^   ^
                            /_\ /_\
                           ^       ^
                          /_\     /_\
                         ^   ^   ^   ^
                        /_\ /_\ /_\ /_\
                       ^               ^
                      /_\             /_\
                     ^   ^           ^   ^
                    /_\ /_\         /_\ /_\
                   ^       ^       ^       ^
                  /_\     /_\     /_\     /_\
                 ^   ^   ^   ^   ^   ^   ^   ^
                /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\
               ^                               ^
              /_\                             /_\
             ^   ^                           ^   ^
            /_\ /_\                         /_\ /_\
           ^       ^                       ^       ^
          /_\     /_\                     /_\     /_\
         ^   ^   ^   ^                   ^   ^   ^   ^
        /_\ /_\ /_\ /_\                 /_\ /_\ /_\ /_\
       ^               ^               ^               ^
      /_\             /_\             /_\             /_\
     ^   ^           ^   ^           ^   ^           ^   ^
    /_\ /_\         /_\ /_\         /_\ /_\         /_\ /_\
   ^       ^       ^       ^       ^       ^       ^       ^
  /_\     /_\     /_\     /_\     /_\     /_\     /_\     /_\
 ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^
/_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\

View Diff

1,2c1,32
<  ^
< /_\ 
---
>                                ^
>                               /_\
>                              ^   ^
>                             /_\ /_\
>                            ^       ^
>                           /_\     /_\
>                          ^   ^   ^   ^
>                         /_\ /_\ /_\ /_\
>                        ^               ^
>                       /_\             /_\
>                      ^   ^           ^   ^
>                     /_\ /_\         /_\ /_\
>                    ^       ^       ^       ^
>                   /_\     /_\     /_\     /_\
>                  ^   ^   ^   ^   ^   ^   ^   ^
>                 /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\
>                ^                               ^
>               /_\                             /_\
>              ^   ^                           ^   ^
>             /_\ /_\                         /_\ /_\
>            ^       ^                       ^       ^
>           /_\     /_\                     /_\     /_\
>          ^   ^   ^   ^                   ^   ^   ^   ^
>         /_\ /_\ /_\ /_\                 /_\ /_\ /_\ /_\
>        ^               ^               ^               ^
>       /_\             /_\             /_\             /_\
>      ^   ^           ^   ^           ^   ^           ^   ^
>     /_\ /_\         /_\ /_\         /_\ /_\         /_\ /_\
>    ^       ^       ^       ^       ^       ^       ^       ^
>   /_\     /_\     /_\     /_\     /_\     /_\     /_\     /_\
>  ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^
> /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\ /_\

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 16 remaining solutions by signing in and submitting your own entry
#17 vansan / VinceVansan - Score: 52 - 08/26/12 @ 10:24
0"zylqa0<C-V>}"yygvI<C-R>z<C-R>z<Esc>G"zy0o<Esc>"ypA<C-R>z<Esc>"ypHq3@a:%s/ $<CR>ZZ

0 comments

#18 Mac Heller-Ogden / twosoul - Score: 74 - 11/10/12 @ 18:50
:let a=1<CR>qq"ayG0<C-V>G$yP"aP<C-O>kVgg:norm <C-R>=a<CR>i  <CR>:let a=a*2<CR>ggq3@q:%s/\s\+$//<CR>ZZ

0 comments

#19 Krzysiek / krzlew - Score: 100 - 08/25/12 @ 21:10
:map x gg0<c-v>G$yGo<esc>PP<CR>:map z i <esc><CR>x:1,2 no<S-Tab> 2z<CR>x:<Up><Left><BS>4<Home><C-Right><BS>4<CR>x:<Up><Left><BS>8<Home><C-Right><BS>8<CR>x:<Up><Left><BS>16<Home><C-Right><BS>16<CR>:%s/ $<CR>ZZ

0 comments

#20 Tyler Breisacher / tbreisacher - Score: 160 - 08/25/12 @ 19:08
qaG$:let x=col('.')<CR>{$:while col('.')<x<CR>s/$/ /<CR>normal $<CR>endwhile<CR><C-V>0GyGo<Esc>PPt^l:let y=col('.')<CR>qqb-:execute "normal ".y."i \<ESC>"<CR>q@b@a4@b@a8@b@a16@b:%s/ *$//<CR>ZZ

0 comments

Created by: tbreisacher

20 active golfers, 62 entries

Leaderboard (lowest score wins):
25
#1 - Conner McDaniel / connermcd

09/03/2012 at 07:39PM

25
#2 - Victor Ramirez / virako

10/15/2012 at 09:42AM

25
#3 - Petro Тrouq / zulolosi

07/03/2013 at 06:23PM

26
#4 - Urtica dioica / udioica

08/30/2012 at 09:55PM

26
#5 - Édouard M'tou / DouardM

10/08/2012 at 09:20PM

26
#6 - John Braxler / braxler

10/03/2014 at 06:26PM

29
#7 - Kerson Hsiao / KersonHsiao

08/26/2012 at 04:37PM

31
#8 - Justin Love / wondible

09/04/2012 at 01:44AM

31
#9 - Jimmy McRascal / JimmyMcRascal

07/12/2014 at 06:14AM

31
#10 - pftb12345 / pftb12345

05/10/2015 at 02:40PM

31
#11 - Saki Gw / Sakigw

04/28/2017 at 02:31PM

34
#12 - Joonas Pihlajamaa / jokkebk

03/28/2014 at 03:12PM

35
#13 - deigen / deigen0

08/29/2012 at 07:55AM

36
#14 - Vasil Sakarov / vsakarov

09/20/2012 at 01:12PM

41
#15 - Rod Knowlton / codelahoma

09/04/2012 at 08:41PM

46
#16 - Bunwut Tson / NbTson

11/07/2012 at 02:26PM

52
#17 - vansan / VinceVansan

08/26/2012 at 10:24AM

74
#18 - Mac Heller-Ogden / twosoul

11/10/2012 at 06:50PM

100
#19 - Krzysiek / krzlew

08/25/2012 at 09:10PM

160
#20 - Tyler Breisacher / tbreisacher

08/25/2012 at 07:08PM