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 4d1e037dde2f897c2a000417

Reverse and count

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

Start file
Sixth line
Fifth line
Fourth line
Third line
Second line
First line
End file
1. First line
2. Second line
3. Third line
4. Fourth line
5. Fifth line
6. Sixth line

View Diff

1,6c1,6
< Sixth line
< Fifth line
< Fourth line
< Third line
< Second line
< First line
---
> 1. First line
> 2. Second line
> 3. Third line
> 4. Fourth line
> 5. Fifth line
> 6. Sixth line

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 148 remaining solutions by signing in and submitting your own entry
#149 neleai / @enlaei - Score: 78 - 12/31/10 @ 21:49
dd<Down><Down><Down><Down>p<Up>dd<Up><Up><Up><Up>pdd<Home><Up>p<Up>dd<Down><Down><Down>p<Up>dd<Up><Up><Up>p<Down>ddp<Up><Up><Up><Up>i1. <Down><Home>2. <Down><Home>3. <Down><Home>4. <Down><Home>5.,<BS> <Down><Home>6. <Esc>:wq<CR>

0 comments


Created by: @jamesconroyfinn

149 active golfers, 384 entries

Leaderboard (lowest score wins):
25
#61 - Asmund / @herrasbe

01/07/2011 at 10:22PM

25
#62 - Rob Ciaccio / @RobertoCalavera

01/21/2011 at 07:07PM

25
#63 - Michał Taszycki / @mehowte

01/24/2011 at 02:12PM

25
#64 - Trevor Powell / @DoomedBunnies

12/01/2011 at 05:53AM

25
#65 - 無ん垢の叫び / @john_ababa

03/13/2012 at 08:21AM

25
#66 - Tyler / @tylerbindon

04/07/2013 at 05:23AM

25
#67 - Joonas Pihlajamaa / @jokkebk

02/21/2014 at 10:14AM

25
#68 - Niels Madan / @nielsmadan

04/10/2015 at 01:47PM

26
#69 - Matthew Draper / @_matthewd

12/31/2010 at 04:56PM

26
#70 - Will Gray / @graywh

12/31/2010 at 07:41PM

26
#71 - clint tseng / @cxlt

12/31/2010 at 09:38PM

26
#72 - Ilya Ermolin / @ermolinis

12/31/2010 at 10:17PM

26
#73 - Pierre / @Pihour

01/01/2011 at 01:58AM

26
#74 - Nándor Komzák / @rubymood

01/01/2011 at 02:16AM

26
#75 - Denis Odorcic / @denisodorcic

01/02/2011 at 01:09AM

26
#76 - PA Parent / @paparent

01/02/2011 at 01:52PM

26
#77 - Paul King / @nrocy

01/02/2011 at 05:49PM

26
#78 - Mattiassich Ákos / @mattiassicha

01/03/2011 at 02:34PM

26
#79 - Avinash Baliga / @avinashbaliga

03/27/2011 at 07:58PM

26
#80 - Jesús Espino / @jespinog

09/05/2011 at 08:19PM

26
#81 - ltn614 / @ltn614

09/30/2015 at 12:36PM

26
#82 - Daniel / @Daniel00288663

04/05/2017 at 02:33PM

26
#83 - RaylanFox / @RaylanFox

04/13/2020 at 04:15PM

27
#84 - Rod Cloutier / @RodCloutier

12/31/2010 at 04:50PM

27
#85 - Guillaume Bonnoron / @gbonnoron

12/31/2010 at 05:19PM

28
#86 - Douglas Stockwell / @dstockwell

12/31/2010 at 06:45PM

28
#87 - Leonard Chin / @lchin

01/02/2011 at 04:29PM

28
#88 - Marcin Sza / @coot_

11/24/2012 at 11:20PM

28
#89 - ajh / @AlexJHammel

12/24/2012 at 06:50PM

28
#90 - James / @Dronak

09/22/2014 at 10:35PM