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 5cace3ba888961000986ec8d

Resort and deup a CSV list

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

Start file
// Animals ordered by continent.
africa = ["hippo", "lion", "atlas bear", "gorilla", "hyena", "giraffe", "zebra"]
asia = ["tiger", "honey bear", "yak", "monkey", "panda"]
europe = ["flea", "brown bear", "ox", "fox", "rat", "deer"]
namerica = ["polar bear", "alligator", "cougar", "wolf", "bison", "reindeer", "raccoon"]
samerica = ["puma", "anaconda", "llama", "capybara", "spectacled bear", "penguin", "sloth"]
australia = ["crocodile", "SPIDERS!", "dingo", "SPIDERS!", "kangaroo", "spider bear", "playtpus", "koala", "SPIDERS!", "echidna"]
End file
// Animals ordered by continent.
africa = ["atlas bear", "giraffe", "gorilla", "hippo", "hyena", "lion", "zebra"]
asia = ["honey bear", "monkey", "panda", "tiger", "yak"]
europe = ["brown bear", "deer", "flea", "fox", "ox", "rat"]
namerica = ["alligator", "bison", "cougar", "polar bear", "raccoon", "reindeer", "wolf"]
samerica = ["anaconda", "capybara", "llama", "penguin", "puma", "sloth", "spectacled bear"]
australia = ["SPIDERS!", "crocodile", "dingo", "echidna", "kangaroo", "koala", "playtpus", "spider bear"]

View Diff

2,7c2,7
< africa = ["hippo", "lion", "atlas bear", "gorilla", "hyena", "giraffe", "zebra"]
< asia = ["tiger", "honey bear", "yak", "monkey", "panda"]
< europe = ["flea", "brown bear", "ox", "fox", "rat", "deer"]
< namerica = ["polar bear", "alligator", "cougar", "wolf", "bison", "reindeer", "raccoon"]
< samerica = ["puma", "anaconda", "llama", "capybara", "spectacled bear", "penguin", "sloth"]
< australia = ["crocodile", "SPIDERS!", "dingo", "SPIDERS!", "kangaroo", "spider bear", "playtpus", "koala", "SPIDERS!", "echidna"]
---
> africa = ["atlas bear", "giraffe", "gorilla", "hippo", "hyena", "lion", "zebra"]
> asia = ["honey bear", "monkey", "panda", "tiger", "yak"]
> europe = ["brown bear", "deer", "flea", "fox", "ox", "rat"]
> namerica = ["alligator", "bison", "cougar", "polar bear", "raccoon", "reindeer", "wolf"]
> samerica = ["anaconda", "capybara", "llama", "penguin", "puma", "sloth", "spectacled bear"]
> australia = ["SPIDERS!", "crocodile", "dingo", "echidna", "kangaroo", "koala", "playtpus", "spider bear"]

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 19 remaining solutions by signing in and submitting your own entry
#20 이종혁 / @BluePaisa - Score: 479 - 04/17/19 @ 09:39
qq+f[df]A[]<Esc>q5@qHf]f]jf]"i"<CR>i"atlas bear',<BS><BS>", "giraffe", "gorilla", "hippo", "hyena", "lion", "zebra"<Esc>ji"honey bear", "monkey"m "<BS><BS><BS>, "panda", "tiger", "yak"<Esc>ji"brown bear", "deer", "flea", "fox", "ox", "rat"<Esc>ji"alligator", "bison", "cougar", "poa<BS>lar bear", "raccoon", "reindeer", "wolf"<Esc>ji"anaconda", "capp<BS>ybara", "llama", "penguin", "puma", "sloth'<BS>", "spectacled bear"<Esc>i<Esc>ji"SPIDERS!", "crocodile", "dingo", "d<BS>echidna", "kangato<BS><BS>roo", "koala", "playtpus", "spider bear"<Esc>ZZ

0 comments


Created by: @deft_code

20 active golfers, 62 entries

Leaderboard (lowest score wins):
44
#1 - Titouan Teyssier / @TitouanT_

04/09/2019 at 10:07PM

44
#2 - Smylers / @Smylers2

04/10/2019 at 01:21PM

44
#3 - John Braxler / @braxler

04/10/2019 at 04:09PM

44
#4 - Roger Stoltz / @rogsto1

04/10/2019 at 08:55PM

44
#5 - alekfed / @alek_fed

04/14/2019 at 04:38PM

44
#6 - Darren Weston / @dazWestonUK

04/18/2019 at 08:55PM

49
#7 - J. Nick Terry / @deft_code

04/09/2019 at 09:21PM

60
#8 - Rand Omperson / @197258444

04/17/2019 at 07:47PM

63
#9 - Amado Antonini / @AmadoAntonini

04/15/2019 at 12:47PM

66
#10 - Sebastian Korten / @FlashKorten

04/09/2019 at 07:55PM

70
#11 - Valacar / @valacar

04/10/2019 at 01:06AM

70
#12 - james_bunch / @james_bunch

04/11/2019 at 12:58AM

70
#13 - Kim Hwa Joong / @hanmwoi

04/11/2019 at 12:34PM

70
#14 - royaso / @royaso

04/12/2019 at 03:49AM

70
#15 - Vimfiz / @vimfiz

04/16/2019 at 09:13PM

70
#16 - Gitsnik / @dracyrys

04/19/2019 at 12:21PM

77
#17 - Olle NoRdesjö / @Rasinj

04/21/2019 at 12:29AM

114
#18 - Rob Pilling / @bobrippling

04/12/2019 at 09:10AM

210
#19 - TimMcGuire / @mcguire

04/21/2019 at 10:51PM

479
#20 - 이종혁 / @BluePaisa

04/17/2019 at 09:39AM