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 54 remaining solutions by signing in and submitting your own entry
#55 Gerald Tilma / GeraldTilma - Score: 26 - 10/21/15 @ 00:47
4l<C-V>G0x:sor u<CR><C-V>GkA,<Esc>23J==ZZ

0 comments

#56 merphant / merphant - Score: 26 - 10/24/15 @ 07:15
<C-V>Gwd:sor u<CR><C-V>22GA,<Esc>23J0dwZZ

0 comments

#57 Will / obiwan__k3n00bi - Score: 26 - 08/25/16 @ 02:22
<C-V>Gwd:sor nu<CR>d0<C-V>Gk$A,<Esc>23JZZ

0 comments

#58 Elizabeth / sprinkles418 - Score: 27 - 03/03/15 @ 17:26
<C-V>Gwd:sor un<CR><C-V>GA,<Esc>gvJ$x^d0ZZ

0 comments

#59 Gurukandhamoorthi / Gurukandhamoor1 - Score: 27 - 08/05/17 @ 16:26
<C-V>GWd:sor nu<CR><C-V>GkA,<Esc>23J0dt1ZZ

0 comments

#60 Tim Chase / gumnos - Score: 28 - 02/16/15 @ 16:48
Q%s/.* <CR>sor un<CR>,$-s/\n/, <CR>x<CR>

0 comments

#61 Robin Ramael / RobinRamael - Score: 28 - 05/30/16 @ 14:03
Q%s/.* <CR>sor un<CR>,$-s/\n/, <CR>x<CR>

0 comments

#62 Anoop Kumar / anooplive - Score: 29 - 02/16/15 @ 18:04
<C-V>Gwdu<C-V>Gwd:sor u<CR><C-V>GkA,<Esc>VGJ==ZZ

0 comments

#63 Dmitry Zudochkin / vredniy - Score: 31 - 02/17/15 @ 17:31
f|<C-V>G0xVG:sor un<CR><C-V>GA,<Esc>VGJ$x04xZZ

0 comments

#64 James / Dronak - Score: 32 - 02/16/15 @ 16:32
qq2wd0A, <Esc>+q31@q:sor un<CR>23JelDZZ

0 comments

#65 Ψαροκροκέτα / psarokroketa - Score: 32 - 07/29/17 @ 15:16
<C-V>Gwd:sor nu<CR><CR>d0ukwd0<C-V>Gk$A,<Esc>23JZZ

0 comments

#66 Oliver Christ / 0liverChrist - Score: 33 - 04/06/15 @ 20:01
<C-V>Glld:sor nu|%s/\n */, <CR><Home>dt1<End>xxZZ

0 comments

#67 Wandering ponderer / 0proxycon - Score: 34 - 02/16/15 @ 19:38
qqA,<Esc>03dwjq32@A32@q:sor un<CR>23J$xZZ

0 comments

#68 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

68 active golfers, 168 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 / ricardolimaapps

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

24
#31 - Liam Thurston / lthurston188

08/18/2015 at 05:15AM

24
#32 - Jonas Nockert / lemonad

11/19/2015 at 07:25PM

24
#33 - Jon Krause / jkrause314

01/10/2016 at 04:59AM

24
#34 - И К / igorjan94

09/15/2016 at 10:01AM

25
#35 - gybilis / gybilis

02/16/2015 at 08:29PM

25
#36 - Jeremie / jermoer

02/17/2015 at 01:14AM

25
#37 - mnx / mnxx

02/17/2015 at 09:20AM

25
#38 - Phil Runninger / PhilRunninger

02/17/2015 at 05:43PM

25
#39 - Alex Bartol / alexbartol

05/05/2015 at 07:25PM

25
#40 - benekeusz / benekeusz

05/06/2015 at 10:17AM

25
#41 - Pete Sevander / Sevanteri

11/13/2015 at 12:57PM

25
#42 - Dimitar Dimitrov / kurkale6ka

03/21/2016 at 05:36PM

25
#43 - Daniel / Daniel00288663

04/04/2017 at 08:28AM

25
#44 - Kevin Ash / ashkevinm

04/13/2017 at 03:15PM

26
#45 - Carlos López / morrizon

02/16/2015 at 07:25PM

26
#46 - brett / brettyukich

02/16/2015 at 10:13PM

26
#47 - xieyh11 / xieyh11

02/17/2015 at 03:46AM

26
#48 - Matthieu Crapet / mcr05

02/17/2015 at 05:48PM

26
#49 - Chris Edwards / boise_chris

02/26/2015 at 04:14PM

26
#50 - Carlos A Henríquez Q / lagunex

03/01/2015 at 01:15PM

26
#51 - Yuan Guan / yuanguan89

03/02/2015 at 04:50AM

26
#52 - Deepak Surti / dmsurti

03/17/2015 at 10:34AM

26
#53 - Gerhard Gappmeier / gergap

09/15/2015 at 04:09PM

26
#54 - Walker Boh / walker_boh

10/12/2015 at 11:27AM

26
#55 - Gerald Tilma / GeraldTilma

10/21/2015 at 12:47AM

26
#56 - merphant / merphant

10/24/2015 at 07:15AM

26
#57 - Will / obiwan__k3n00bi

08/25/2016 at 02:22AM

27
#58 - Elizabeth / sprinkles418

03/03/2015 at 05:26PM

27
#59 - Gurukandhamoorthi / Gurukandhamoor1

08/05/2017 at 04:26PM

28
#60 - Tim Chase / gumnos

02/16/2015 at 04:48PM

28
#61 - Robin Ramael / RobinRamael

05/30/2016 at 02:03PM

29
#62 - Anoop Kumar / anooplive

02/16/2015 at 06:04PM

31
#63 - Dmitry Zudochkin / vredniy

02/17/2015 at 05:31PM

32
#64 - James / Dronak

02/16/2015 at 04:32PM

32
#65 - Ψαροκροκέτα / psarokroketa

07/29/2017 at 03:16PM

33
#66 - Oliver Christ / 0liverChrist

04/06/2015 at 08:01PM

34
#67 - Wandering ponderer / 0proxycon

02/16/2015 at 07:38PM

36
#68 - chvzvhn / chvzvhn

04/26/2015 at 06:48PM