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 54e2169fb89efb2ab10012e6

Sorting database text output

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

Start file
      0 |    1
      0 |   24
      1 |    1
      1 |    2
      1 |    3
      1 |    4
      1 |   15
      1 |   24
      1 |   62
      1 |  107
      2 |    1
      2 |    2
      2 |    8
      2 |   15
      2 |   18
      2 |   25
      2 |   28
      2 |   47
      2 |   65
      2 |   69
      2 |   76
      2 |   99
      2 |  103
      2 |  110
      2 |  153
      3 |    3
      3 |   32
      3 |   49
      3 |   65
      3 |   76
      3 |   96
      4 |    2
End file
1, 2, 3, 4, 8, 15, 18, 24, 25, 28, 32, 47, 49, 62, 65, 69, 76, 96, 99, 103, 107, 110, 153

View Diff

1,32c1
<       0 |    1
<       0 |   24
<       1 |    1
<       1 |    2
<       1 |    3
<       1 |    4
<       1 |   15
<       1 |   24
<       1 |   62
<       1 |  107
<       2 |    1
<       2 |    2
<       2 |    8
<       2 |   15
<       2 |   18
<       2 |   25
<       2 |   28
<       2 |   47
<       2 |   65
<       2 |   69
<       2 |   76
<       2 |   99
<       2 |  103
<       2 |  110
<       2 |  153
<       3 |    3
<       3 |   32
<       3 |   49
<       3 |   65
<       3 |   76
<       3 |   96
<       4 |    2
---
> 1, 2, 3, 4, 8, 15, 18, 24, 25, 28, 32, 47, 49, 62, 65, 69, 76, 96, 99, 103, 107, 110, 153

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 82 remaining solutions by signing in and submitting your own entry
#83 chvzvhn / @chvzvhn - Score: 36 - 04/26/15 @ 18:48
qqd2wjq31@q:sor nu<CR>qqA, <Esc>Jq21@qV2<ZZ

0 comments


Created by: @kirk_bauer

83 active golfers, 223 entries

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

02/16/2015 at 05:36PM

24
#2 - John Braxler / @braxler

02/16/2015 at 07:33PM

24
#3 - Terence Hang / @technic_tec

02/16/2015 at 09:23PM

24
#4 - Eduardo / @earada

02/17/2015 at 12:35AM

24
#5 - Strabs / @artistavenue

02/17/2015 at 10:18AM

24
#6 - Laurent Stacul / @stac47

02/17/2015 at 02:07PM

24
#7 - Ricardo Lima / @ricponteslima

02/17/2015 at 03:43PM

24
#8 - Gammelin Guillaume / @ggammelin

02/17/2015 at 04:00PM

24
#9 - 0x255 / @0x255

02/17/2015 at 08:15PM

24
#10 - Petro Тrouq / @zulolosi

02/18/2015 at 10:45PM

24
#11 - Felixoid Sage / @mr_felixoid

02/19/2015 at 10:18AM

24
#12 - esquifit / @henroboke

02/19/2015 at 03:37PM

24
#13 - Naseem Al-Naji / @NaseemAlnaji

02/19/2015 at 08:43PM

24
#14 - Thiago Prado / @5k1pp3r

02/20/2015 at 01:43AM

24
#15 - Yann Moisan / @YannMoisan

02/21/2015 at 08:43AM

24
#16 - Alan Berndt / @bentglasstube

02/23/2015 at 04:53PM

24
#17 - Felix / @DoubleFelix_

02/24/2015 at 11:32AM

24
#18 - paulfariello ✏️ / @paulfariello

02/25/2015 at 04:33PM

24
#19 - octotep / @octotep

02/25/2015 at 07:41PM

24
#20 - magizbox / @rain_1024

02/26/2015 at 07:48AM

24
#21 - Yannic Haupenthal / @yhaupenthal

03/01/2015 at 10:45AM

24
#22 - Darth Shuvalov / @shuvalov_anton

03/01/2015 at 12:54PM

24
#23 - Matthew Pryor / @HodgekaGames

03/03/2015 at 10:32PM

24
#24 - Ben Plantinga / @benplantinga

03/05/2015 at 05:47PM

24
#25 - DrHobo / @_DrHobo_

03/09/2015 at 09:51PM

24
#26 - Ala' Ibrahim / @alaa_ibrahim

03/10/2015 at 08:34AM

24
#27 - Alexander Kazakov / @volandkot

03/30/2015 at 07:04AM

24
#28 - pftb12345 / @pftb12345

03/31/2015 at 12:08PM

24
#29 - Emmanuel Denloye-Ito / @EmmanuelDenloye

04/11/2015 at 06:29PM

24
#30 - Mutter Mumble / @muttermumble

07/12/2015 at 11:14AM