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):
26
#61 - Will / @obiwan__k3n00bi

08/25/2016 at 02:22AM

27
#62 - Elizabeth / @sprinkles418

03/03/2015 at 05:26PM

27
#63 - Gurukandhamoorthi / @Gurukandhamoor1

08/05/2017 at 04:26PM

28
#64 - Tim Chase / @gumnos

02/16/2015 at 04:48PM

28
#65 - Robin Ramael / @RobinRamael

05/30/2016 at 02:03PM

29
#66 - Anoop Kumar / @anooplive

02/16/2015 at 06:04PM

30
#67 - Paul Draghicescu / @pdragy

03/29/2018 at 12:00AM

30
#68 - Charlie OConor / @charlieoconor

04/15/2018 at 10:58PM

31
#69 - Dmitry Zudochkin / @zudochkin

02/17/2015 at 05:31PM

31
#70 - RockerZZY / @rocker_zzy

07/08/2020 at 11:49PM

32
#71 - James / @Dronak

02/16/2015 at 04:32PM

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

07/29/2017 at 03:16PM

33
#73 - Oliver Christ / @0liverChrist

04/06/2015 at 08:01PM

34
#74 - Wandering ponderer / @0proxycon

02/16/2015 at 07:38PM

36
#75 - chvzvhn / @chvzvhn

04/26/2015 at 06:48PM