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 4d1a5275a860b74472000110

Sort and add attributes

Sort the states and add the attribute country to each record.

Start file
State.new(:name => "Ohio")
State.new(:name => "Wisconsin")
State.new(:name => "Iowa")
State.new(:name => "Virginia")
State.new(:name => "Utah")
State.new(:name => "Arizona")
State.new(:name => "Mississippi")
State.new(:name => "Michigan")
State.new(:name => "Virgin Islands")
State.new(:name => "Delaware")
State.new(:name => "North Carolina")
State.new(:name => "Montana")
State.new(:name => "Vermont")
State.new(:name => "New Jersey")
State.new(:name => "Illinois")
State.new(:name => "New Hampshire")
State.new(:name => "Kansas")
State.new(:name => "Texas")
State.new(:name => "Alabama")
State.new(:name => "Pennsylvania")
State.new(:name => "Louisiana")
State.new(:name => "Washington")
State.new(:name => "North Dakota")
State.new(:name => "Indiana")
State.new(:name => "South Carolina")
State.new(:name => "Hawaii")
State.new(:name => "Idaho")
State.new(:name => "Nebraska")
State.new(:name => "Tennessee")
State.new(:name => "Wyoming")
State.new(:name => "Colorado")
State.new(:name => "Rhode Island")
State.new(:name => "Connecticut")
State.new(:name => "Maryland")
State.new(:name => "Alaska")
State.new(:name => "Minnesota")
State.new(:name => "West Virginia")
State.new(:name => "Oklahoma")
State.new(:name => "Arkansas")
State.new(:name => "New Mexico")
State.new(:name => "Missouri")
State.new(:name => "Guam")
State.new(:name => "Maine")
State.new(:name => "New York")
State.new(:name => "Florida")
State.new(:name => "South Dakota")
State.new(:name => "Georgia")
State.new(:name => "Kentucky")
State.new(:name => "Oregon")
State.new(:name => "Nevada")
State.new(:name => "Massachusetts")
State.new(:name => "California")
End file
State.new(:name => "Alabama", :country => "USA")
State.new(:name => "Alaska", :country => "USA")
State.new(:name => "Arizona", :country => "USA")
State.new(:name => "Arkansas", :country => "USA")
State.new(:name => "California", :country => "USA")
State.new(:name => "Colorado", :country => "USA")
State.new(:name => "Connecticut", :country => "USA")
State.new(:name => "Delaware", :country => "USA")
State.new(:name => "Florida", :country => "USA")
State.new(:name => "Georgia", :country => "USA")
State.new(:name => "Guam", :country => "USA")
State.new(:name => "Hawaii", :country => "USA")
State.new(:name => "Idaho", :country => "USA")
State.new(:name => "Illinois", :country => "USA")
State.new(:name => "Indiana", :country => "USA")
State.new(:name => "Iowa", :country => "USA")
State.new(:name => "Kansas", :country => "USA")
State.new(:name => "Kentucky", :country => "USA")
State.new(:name => "Louisiana", :country => "USA")
State.new(:name => "Maine", :country => "USA")
State.new(:name => "Maryland", :country => "USA")
State.new(:name => "Massachusetts", :country => "USA")
State.new(:name => "Michigan", :country => "USA")
State.new(:name => "Minnesota", :country => "USA")
State.new(:name => "Mississippi", :country => "USA")
State.new(:name => "Missouri", :country => "USA")
State.new(:name => "Montana", :country => "USA")
State.new(:name => "Nebraska", :country => "USA")
State.new(:name => "Nevada", :country => "USA")
State.new(:name => "New Hampshire", :country => "USA")
State.new(:name => "New Jersey", :country => "USA")
State.new(:name => "New Mexico", :country => "USA")
State.new(:name => "New York", :country => "USA")
State.new(:name => "North Carolina", :country => "USA")
State.new(:name => "North Dakota", :country => "USA")
State.new(:name => "Ohio", :country => "USA")
State.new(:name => "Oklahoma", :country => "USA")
State.new(:name => "Oregon", :country => "USA")
State.new(:name => "Pennsylvania", :country => "USA")
State.new(:name => "Rhode Island", :country => "USA")
State.new(:name => "South Carolina", :country => "USA")
State.new(:name => "South Dakota", :country => "USA")
State.new(:name => "Tennessee", :country => "USA")
State.new(:name => "Texas", :country => "USA")
State.new(:name => "Utah", :country => "USA")
State.new(:name => "Vermont", :country => "USA")
State.new(:name => "Virgin Islands", :country => "USA")
State.new(:name => "Virginia", :country => "USA")
State.new(:name => "Washington", :country => "USA")
State.new(:name => "West Virginia", :country => "USA")
State.new(:name => "Wisconsin", :country => "USA")
State.new(:name => "Wyoming", :country => "USA")

View Diff

1,52c1,52
< State.new(:name => "Ohio")
< State.new(:name => "Wisconsin")
< State.new(:name => "Iowa")
< State.new(:name => "Virginia")
< State.new(:name => "Utah")
< State.new(:name => "Arizona")
< State.new(:name => "Mississippi")
< State.new(:name => "Michigan")
< State.new(:name => "Virgin Islands")
< State.new(:name => "Delaware")
< State.new(:name => "North Carolina")
< State.new(:name => "Montana")
< State.new(:name => "Vermont")
< State.new(:name => "New Jersey")
< State.new(:name => "Illinois")
< State.new(:name => "New Hampshire")
< State.new(:name => "Kansas")
< State.new(:name => "Texas")
< State.new(:name => "Alabama")
< State.new(:name => "Pennsylvania")
< State.new(:name => "Louisiana")
< State.new(:name => "Washington")
< State.new(:name => "North Dakota")
< State.new(:name => "Indiana")
< State.new(:name => "South Carolina")
< State.new(:name => "Hawaii")
< State.new(:name => "Idaho")
< State.new(:name => "Nebraska")
< State.new(:name => "Tennessee")
< State.new(:name => "Wyoming")
< State.new(:name => "Colorado")
< State.new(:name => "Rhode Island")
< State.new(:name => "Connecticut")
< State.new(:name => "Maryland")
< State.new(:name => "Alaska")
< State.new(:name => "Minnesota")
< State.new(:name => "West Virginia")
< State.new(:name => "Oklahoma")
< State.new(:name => "Arkansas")
< State.new(:name => "New Mexico")
< State.new(:name => "Missouri")
< State.new(:name => "Guam")
< State.new(:name => "Maine")
< State.new(:name => "New York")
< State.new(:name => "Florida")
< State.new(:name => "South Dakota")
< State.new(:name => "Georgia")
< State.new(:name => "Kentucky")
< State.new(:name => "Oregon")
< State.new(:name => "Nevada")
< State.new(:name => "Massachusetts")
< State.new(:name => "California")
---
> State.new(:name => "Alabama", :country => "USA")
> State.new(:name => "Alaska", :country => "USA")
> State.new(:name => "Arizona", :country => "USA")
> State.new(:name => "Arkansas", :country => "USA")
> State.new(:name => "California", :country => "USA")
> State.new(:name => "Colorado", :country => "USA")
> State.new(:name => "Connecticut", :country => "USA")
> State.new(:name => "Delaware", :country => "USA")
> State.new(:name => "Florida", :country => "USA")
> State.new(:name => "Georgia", :country => "USA")
> State.new(:name => "Guam", :country => "USA")
> State.new(:name => "Hawaii", :country => "USA")
> State.new(:name => "Idaho", :country => "USA")
> State.new(:name => "Illinois", :country => "USA")
> State.new(:name => "Indiana", :country => "USA")
> State.new(:name => "Iowa", :country => "USA")
> State.new(:name => "Kansas", :country => "USA")
> State.new(:name => "Kentucky", :country => "USA")
> State.new(:name => "Louisiana", :country => "USA")
> State.new(:name => "Maine", :country => "USA")
> State.new(:name => "Maryland", :country => "USA")
> State.new(:name => "Massachusetts", :country => "USA")
> State.new(:name => "Michigan", :country => "USA")
> State.new(:name => "Minnesota", :country => "USA")
> State.new(:name => "Mississippi", :country => "USA")
> State.new(:name => "Missouri", :country => "USA")
> State.new(:name => "Montana", :country => "USA")
> State.new(:name => "Nebraska", :country => "USA")
> State.new(:name => "Nevada", :country => "USA")
> State.new(:name => "New Hampshire", :country => "USA")
> State.new(:name => "New Jersey", :country => "USA")
> State.new(:name => "New Mexico", :country => "USA")
> State.new(:name => "New York", :country => "USA")
> State.new(:name => "North Carolina", :country => "USA")
> State.new(:name => "North Dakota", :country => "USA")
> State.new(:name => "Ohio", :country => "USA")
> State.new(:name => "Oklahoma", :country => "USA")
> State.new(:name => "Oregon", :country => "USA")
> State.new(:name => "Pennsylvania", :country => "USA")
> State.new(:name => "Rhode Island", :country => "USA")
> State.new(:name => "South Carolina", :country => "USA")
> State.new(:name => "South Dakota", :country => "USA")
> State.new(:name => "Tennessee", :country => "USA")
> State.new(:name => "Texas", :country => "USA")
> State.new(:name => "Utah", :country => "USA")
> State.new(:name => "Vermont", :country => "USA")
> State.new(:name => "Virgin Islands", :country => "USA")
> State.new(:name => "Virginia", :country => "USA")
> State.new(:name => "Washington", :country => "USA")
> State.new(:name => "West Virginia", :country => "USA")
> State.new(:name => "Wisconsin", :country => "USA")
> State.new(:name => "Wyoming", :country => "USA")

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 550 remaining solutions by signing in and submitting your own entry
#551 lujianmei / @lujianmei - Score: 80 - 09/05/17 @ 09:14
:sort<CR>:%s/)/,:country => ""<C-B><C-E><C-B><C-E><Left>USA<C-F><Esc><CR>uuu:sort<CR>:%s/)/, :country => "USA:<BS>")/g<CR>ZZ

0 comments


Created by: @cloudsplitter

551 active golfers, 1418 entries

Leaderboard (lowest score wins):
37
#451 - tpoeiras / @tpoeirass

08/01/2021 at 04:35AM

37
#452 - x03n046 / @x03n046

05/13/2022 at 02:55AM

37
#453 - Jayanth Koushik / @jayanthkoushik

07/10/2024 at 07:29AM

38
#454 - Brad Grzesiak / @listrophy

12/28/2010 at 09:43PM

38
#455 - Ches Martin / @ches

12/28/2010 at 10:45PM

38
#456 - Travis Swicegood / @tswicegood

12/28/2010 at 10:47PM

38
#457 - tridactyla / @tridactyla

12/29/2010 at 12:12AM

38
#458 - Jonathan Wallace / @jonathanwallace

12/29/2010 at 02:08AM

38
#459 - Grant McLean / @grantmnz

12/29/2010 at 08:44AM

38
#460 - Jakub Troszok / @zosoooo

12/29/2010 at 09:36AM

38
#461 - Chris Doble / @chrisdoble

12/30/2010 at 02:09AM

38
#462 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 06:01PM

38
#463 - TchiKong / @tchikong

02/03/2011 at 10:51AM

38
#464 - Mikhail Korepanov / @PanyaKor

06/13/2011 at 01:38PM

38
#465 - Drew Benedetti / @cnorsl

02/16/2012 at 10:51PM

38
#466 - Matty Williams / @matty_jwilliams

08/19/2012 at 09:41AM

38
#467 - Rahul Krishnan / @rahulkrish

11/06/2012 at 06:13AM

38
#468 - Eric Andres / @eric_m_andres

12/06/2012 at 05:30AM

38
#469 - Pradeep Kumar 🇮🇳🇮🇳🇮🇳🇮🇱🇮🇱🇮🇱 / @pradeep6kumar

12/12/2012 at 01:34PM

38
#470 - Brian Besmanoff / @BrianBesmanoff

07/26/2013 at 02:06AM

38
#471 - Felipe Jaramillo F / @mrfelipe

05/15/2014 at 10:27PM

38
#472 - Keith Yong / @keithynator

03/06/2015 at 04:15PM

38
#473 - J. Nick Terry / @deft_code

04/08/2019 at 10:59PM

38
#474 - Aioriya / @AioriyaDonk

09/08/2019 at 01:50AM

38
#475 - RockerZZY / @rocker_zzy

06/18/2020 at 11:44PM

38
#476 - Scott Berger / @scottberger

09/24/2021 at 09:05PM

38
#477 - Mircea Eftimescu / @meftimes

11/07/2021 at 09:35PM

38
#478 - Dima Horshenin / @DimaHorshenin

12/06/2021 at 09:55AM

38
#479 - xiaoao1024 / @xiaoao1024

12/21/2023 at 07:01AM

39
#480 - Duda Dornelles / @dudadornelles

12/28/2010 at 09:21PM