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 42 remaining solutions by signing in and submitting your own entry
#43 μ΄μ’…ν˜ / @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

43 active golfers, 167 entries

Leaderboard (lowest score wins):
44
#1 - πšƒπš’πšπš˜πšžπšŠπš— πšƒπšŽπš’πšœπšœπš’πšŽπš› / @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

44
#7 - Grant / @grant_7788

04/27/2019 at 01:48PM

44
#8 - mkaminaga / @mkmng3

07/01/2019 at 07:14AM

44
#9 - MiΕ‚osz Łakomy / @foobar01123

07/30/2019 at 12:42PM

44
#10 - Martin Delille / @martinodelilo

08/21/2019 at 11:48AM

44
#11 - Cassandra / @kascein

09/18/2019 at 10:05PM

44
#12 - moh ayaya / @AyayaMoh

09/10/2023 at 02:14PM

44
#13 - Aly Thobani / @alythobani

05/31/2024 at 05:34AM

44
#14 - Peppa Pig / @PeppaPi95550250

06/25/2024 at 05:08AM

44
#15 - nickGPT / @nickandbro

08/24/2024 at 10:47PM

46
#16 - Lory / @Lory46845742

11/14/2019 at 03:43PM

46
#17 - Jean George / @JeanGeo20504212

09/10/2021 at 04:45PM

46
#18 - Luoyb / @Luoyb

10/30/2023 at 03:59AM

47
#19 - garry quested / @GQuested

07/09/2019 at 01:23PM

47
#20 - theBecwar / @thebecwar

08/19/2019 at 09:42PM

48
#21 - BaffaloP πŸƒπŸŽ¨ / @bbaffalopp

04/24/2019 at 10:16PM

48
#22 - Arno / @arnoxmp

05/23/2019 at 10:46AM

48
#23 - johnLate / @johnLate

06/14/2019 at 07:37PM

48
#24 - mau-mauricelim / @mau-mauricelim

09/10/2024 at 03:16AM

49
#25 - J. Nick Terry / @deft_code

04/09/2019 at 09:21PM

49
#26 - RockerZZY / @rocker_zzy

06/21/2020 at 11:36PM

58
#27 - Ivo BlΓΆchliger / @aigledesalpes

08/06/2019 at 07:44AM

60
#28 - Rand Omperson / @197258444

04/17/2019 at 07:47PM

62
#29 - Zach Ingbretsen / @ZIngbretsen

09/08/2019 at 01:45PM

63
#30 - Amado Antonini / @AmadoAntonini

04/15/2019 at 12:47PM