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 508fe9f57acca60002000037

Stairs Indenting

Indent each line with <line number> whitespaces.

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

View Diff

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

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 129 remaining solutions by signing in and submitting your own entry
#130 Jason Wolf / zephyr_wolf - Score: 16 - 11/08/12 @ 13:09
qqI <C-O>y0<Esc>jPq9@qZZ

0 comments


#131 Roland Schatz / fl_Overmind - Score: 16 - 12/14/12 @ 12:09
qaPI <Esc>wy0jq9@aZZ

0 comments


#132 Evan Shrubsole / evanshrubsole - Score: 16 - 04/01/13 @ 15:28
qqyw@"I <Esc>+q9@qZZ

0 comments


#133 DOUG BLACK / dougblackio - Score: 16 - 04/08/13 @ 14:37
qa<C-V>GI <Esc>j$q11@aZZ

0 comments


#134 Hachez Floran / FloranHachez - Score: 16 - 09/05/13 @ 09:27
<CR>:%norm <C-V><C-V>GI <CR>ZZ

0 comments


#135 Mathias Rav / iaddquotes - Score: 17 - 11/13/12 @ 22:49
:%norm <C-V><C-V>GI <CR>:wq<CR>

0 comments


#136 Darcy Parker / DarcyParker - Score: 19 - 10/31/12 @ 23:46
Oj.<Esc>9".pdd<C-V>GI <Esc>@"ZZ

0 comments


#137 Chasetopher / chasetopherlee - Score: 19 - 11/02/12 @ 05:38
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#138 Miguel Sánchez / miguelsr1987 - Score: 19 - 11/07/12 @ 16:11
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#139 Татос Бабаджанян / snpdevone - Score: 19 - 11/12/12 @ 10:57
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#140 makala noble / mnoble01 - Score: 19 - 11/13/12 @ 08:32
i <Esc>qq0y^jPi <Esc>q9@qZZ

0 comments


#141 Omer Lachish / rauchy - Score: 19 - 11/18/12 @ 07:11
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#142 Jesper Petersson / PeterssonJesper - Score: 19 - 11/19/12 @ 13:18
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#143 Garrett Oreilly / garrett_oh - Score: 19 - 11/21/12 @ 05:51
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#144 Brian Stolz / tecnobrat - Score: 19 - 11/21/12 @ 17:05
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#145 Ravi S Sinha / ambidextrousTx - Score: 19 - 11/26/12 @ 08:47
i <Esc>qay^jPi <Esc>0q9@aZZ

0 comments


#146 Matt Walker / _walkermatt - Score: 19 - 11/28/12 @ 18:07
i <Esc>qqy^jPI <Esc>0q9@qZZ

0 comments


#147 Nathan / NathanHarperoni - Score: 19 - 08/07/13 @ 14:36
Oj.<Esc>9".pdd<C-V>GI <Esc>@"ZZ

0 comments


#148 Jacob Branaugh / jacobbranaugh - Score: 19 - 06/25/14 @ 21:06
I <Esc>qqywjPI <Esc>0q9@qZZ

0 comments


#149 Alex Hammel / AlexJHammel - Score: 20 - 12/27/12 @ 15:23
i <Esc>qqYpi <Esc><C-A>q8@qjdGZZ

0 comments


#150 Paul Gideon Dann / giddie - Score: 22 - 10/31/12 @ 14:10
i <Esc>jqqky^jPI <Esc>0jq8@QZZ

0 comments


#151 Adelar S. Queiróz / adelarsq - Score: 22 - 01/31/13 @ 23:08
i <Esc>jqqky^jPI <Esc>j0q8@qZZ

0 comments


#152 Murali Suriar / msuriar - Score: 24 - 11/17/12 @ 10:59
:set et sw=1<CR>qq>Gjq9@qZZ

0 comments


#153 Nicolas Friedli / NicolasFriedli - Score: 25 - 10/31/12 @ 21:24
<C-V>GI <Esc><Down>.<Down>.<Down>.<Down>.<Down>.<Down>.<Down>.<Down>.<Down>.ZZ

0 comments


#154 Raphael / rnstlr - Score: 25 - 11/26/13 @ 23:36
<C-V>GI <Esc>j.j.j.j.j.j.j.j.j.ZZ

0 comments


#155 Nicholas Lee-Hone / NicholasLeeHone - Score: 25 - 10/13/14 @ 20:12
<C-V>GI <Esc>j.j.j.j.j.j.j.j.j.ZZ

0 comments


#156 Eric Andres / eric_m_andres - Score: 27 - 12/07/12 @ 20:54
<C-V>GI <Esc>j.j.j.j.j.j.j.j.j.j<Esc>ZZ

0 comments


#157 Daniel Allen Deutsch / cmmn_nighthawk - Score: 33 - 08/24/16 @ 01:10
I <Esc>j2.j3.j4.j5.j6.j7.j8.j9.j10.ZZ

0 comments


#158 Caroline / carokenworthy - Score: 33 - 08/24/16 @ 02:06
I <Esc>j2.j3.j4.j5.j6.j7.j8.j9.j10.ZZ

0 comments


#159 bogwonch / bogwonch - Score: 34 - 10/30/12 @ 20:03
qq"ayw:norm <C-R>ai <CR>qx:%norm @q<CR><Esc>:wq<CR>

whimful: yo i'm just learning ... apparently ending with ZZ lowers your score more than :wq as an ending command :P

coot_: another trick is to use :no<S-Tab> which expands to :normal

giddie: You can also use <C-R>" to paste default register, meaning you can just do yw at the beginning instead of "ayw. You still seem to need "norm" in the first macro, but the second can be :%no<S-Tab>. I can get 28 out of this approach.

giddie: In fact you can get 24 if you use <C-R><C-W> instead of yanking and pasting.

4 comments


#160 Alex Bartol / alexbartol - Score: 35 - 05/05/15 @ 21:03
:set ts=9<BS>11 | set sw=1<CR>qq>Gjq9@qZZ

0 comments


#161 Max Sherman / johnislarry - Score: 46 - 11/12/12 @ 12:22
qqi <Esc>qj2@qj3@qj4@qj5@qj6@qj7@qj8@qj9@qj10@q:x<CR>

0 comments


#162 Lim Han / tagore79 - Score: 69 - 11/04/12 @ 14:19
1i <Esc>j2i <Esc>2i<Esc>j3i<Esc>i<Esc>3i <Esc>j4i <Esc>j5i <Esc>j6i <Esc>j7i <Esc>j8i <Esc>j9i <Esc>jh10i <Esc>j:21<BS><BS>wq!<CR>

0 comments


Created by: dbrgn

162 active golfers, 348 entries

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

12/31/2012 at 01:30AM

12
#2 - Marco Hinz / _mhinz_

05/22/2013 at 09:41AM

12
#3 - Petro Тrouq / zulolosi

05/31/2013 at 09:59PM

12
#4 - Ingo / ist3fani

07/30/2013 at 03:08PM

12
#5 - John Papanastasiou / JohnPapps

08/27/2013 at 07:06PM

12
#6 - Sam Rose / samwhoo

08/27/2013 at 07:10PM

12
#7 - Yann Moisan / YannMoisan

01/03/2014 at 07:13PM

12
#8 - pikaren / REALpikaren

01/06/2014 at 03:35PM

12
#9 - Domingue Justin / _jdomingue

01/10/2014 at 05:50PM

12
#10 - Yiyang Chen / yiyangc91

03/15/2014 at 05:05PM

12
#11 - John Braxler / braxler

04/14/2014 at 01:48PM

12
#12 - pftb12345 / pftb12345

04/12/2015 at 11:06PM

12
#13 - Jon Krause / jkrause314

01/11/2016 at 01:44AM

12
#14 - trx / trxdbg

10/17/2016 at 04:56AM

12
#15 - Christopher Erin / MCNormalMode

01/18/2017 at 01:59AM

12
#16 - jn / j1357924

08/24/2017 at 07:04PM

12
#17 - Turkey Man / lvturkeyman

11/27/2017 at 03:03PM

12
#18 - BarbaJol / drpproteus

01/11/2018 at 05:06PM

13
#19 - Conner McDaniel / connermcd

10/30/2012 at 04:09PM

13
#20 - Rahul Krishnan / rahulkrish

11/04/2012 at 04:59PM

13
#21 - Vasil Sakarov / vsakarov

11/11/2012 at 07:57AM

13
#22 - xaizek / xaizek

11/15/2012 at 09:05AM

13
#23 - Justin Love / wondible

11/25/2012 at 10:26PM

13
#24 - Drew Neil / nelstrom

11/27/2012 at 12:07AM

13
#25 - mattgibb / mattgibb

11/27/2012 at 08:49PM

13
#26 - Jordan Eldredge / captbaritone

12/01/2012 at 07:32AM

13
#27 - Kerson Hsiao / KersonHsiao

01/03/2013 at 04:31AM

13
#28 - Joel Elkins / dice_tea

03/05/2013 at 06:13AM

13
#29 - Trevor Powell / DoomedBunnies

03/20/2013 at 11:18PM

13
#30 - Shoop Da Whoop / ShoopDaWhoop8

06/06/2013 at 08:50PM