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):
33
#271 - 3eneliath / @3eneliath

03/18/2024 at 07:03PM

33
#272 - Anaritus / @Anaritus

03/25/2024 at 08:41AM

33
#273 - schrjako / @schrjako

04/06/2024 at 09:40AM

33
#274 - wihinenh / @wihinenh

04/29/2024 at 05:17PM

33
#275 - ck961018 / @ck961018

05/22/2024 at 11:35AM

33
#276 - Aly Thobani / @alythobani

05/27/2024 at 12:58AM

33
#277 - shannon / @ShannonGu1031

05/28/2024 at 07:52AM

33
#278 - saimen / @saimen

06/09/2024 at 08:52AM

33
#279 - alexeypetrenko / @alexeypetrenko

06/27/2024 at 01:24PM

33
#280 - Petro Mudrievskyj / @petemud

06/28/2024 at 08:50AM

33
#281 - molnija3d / @molnija3d

07/06/2024 at 07:34AM

33
#282 - Tsimon Dorakh / @Tsimon-Dorakh

08/03/2024 at 04:04PM

33
#283 - KarateSnoopy / @KarateSnoopy

08/12/2024 at 09:45AM

33
#284 - Henrik Lehtonen / @helehto

08/17/2024 at 11:49PM

33
#285 - Diwakar Singh Parmar / @parmardiwakar150

08/27/2024 at 01:44PM

33
#286 - nickGPT / @nickandbro

08/29/2024 at 12:35AM

33
#287 - Suhaib Murshid / @suhaibm

09/01/2024 at 03:17PM

33
#288 - KoroneListener / @KoroneListener

09/03/2024 at 04:04PM

34
#289 - Jiří Stránský / @jistr

12/29/2010 at 08:05PM

34
#290 - Akira Matsuda / @a_matsuda

12/30/2010 at 02:45AM

34
#291 - akatz / @akatz

12/30/2010 at 06:51AM

34
#292 - Takayuki Tsukitani / @tsukkee

12/30/2010 at 07:46AM

34
#293 -  Ikhsan Maulana / @ixandidu

12/30/2010 at 09:48AM

34
#294 - Kornél Lugosi / @Coornail

12/30/2010 at 10:24AM

34
#295 - Fred Nias / @frednias

12/30/2010 at 01:13PM

34
#296 - uuu / @uu59

12/30/2010 at 06:48PM

34
#297 - smergo / @smergo

12/30/2010 at 08:07PM

34
#298 - Joe McCall / @joem86

12/30/2010 at 08:22PM

34
#299 - Jim Garvin / @coderifous

12/30/2010 at 08:45PM

34
#300 - Tom Burger / @thomasburger

12/30/2010 at 09:21PM