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 74 remaining solutions by signing in and submitting your own entry
#75 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

75 active golfers, 194 entries

Leaderboard (lowest score wins):
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

24
#35 - Turkey Man / @lvturkeyman

11/28/2017 at 05:01PM

24
#36 - DHM / @DHM29978992

05/21/2018 at 12:23AM

25
#37 - gybilis / @gybilis

02/16/2015 at 08:29PM

25
#38 - Jeremie / @jermoer

02/17/2015 at 01:14AM

25
#39 - mnx / @mnxx

02/17/2015 at 09:20AM

25
#40 - Phil Runninger / @PhilRunninger

02/17/2015 at 05:43PM

25
#41 - Alex Bartol / @alexbartol

05/05/2015 at 07:25PM

25
#42 - benekeusz / @benekeusz

05/06/2015 at 10:17AM

25
#43 - Pete Sevander / @Sevanteri

11/13/2015 at 12:57PM

25
#44 - Dimitar Dimitrov / @kurkale6ka

03/21/2016 at 05:36PM

25
#45 - Daniel / @Daniel00288663

04/04/2017 at 08:28AM

25
#46 - 20speedvegan / @ashkevinm

04/13/2017 at 03:15PM

25
#47 - Mihai / @mihaicristiant

03/26/2019 at 03:59PM

25
#48 - Lory / @Lory46845742

01/17/2020 at 03:04PM

26
#49 - Carlos López / @morrizon

02/16/2015 at 07:25PM

26
#50 - brett / @brettyukich

02/16/2015 at 10:13PM

26
#51 - xieyh11 / @xieyh11

02/17/2015 at 03:46AM

26
#52 - Matt / @mcr05

02/17/2015 at 05:48PM

26
#53 - Chris Edwards / @boise_chris

02/26/2015 at 04:14PM

26
#54 - Carlos A Henríquez Q / @lagunex

03/01/2015 at 01:15PM

26
#55 - Yuan Guan / @yuanguan89

03/02/2015 at 04:50AM

26
#56 - Deepak Surti / @dmsurti

03/17/2015 at 10:34AM

26
#57 - Gerhard Gappmeier / @gergap

09/15/2015 at 04:09PM

26
#58 - Walker Boh / @walker_boh

10/12/2015 at 11:27AM

26
#59 - Gerald Tilma / @GeraldTilma

10/21/2015 at 12:47AM

26
#60 - merphant / @merphant

10/24/2015 at 07:15AM