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):
34
#361 - name / @name65894813

11/28/2018 at 03:47PM

34
#362 - majo senf / @majo_senf

06/21/2019 at 02:31PM

34
#363 - Kenny Low / @kennylow

08/16/2019 at 12:41PM

34
#364 - wrglprmft2 / @wrglprmft2

10/18/2019 at 06:55PM

34
#365 - iBhagwan / @iiBhagwan

06/04/2020 at 05:21PM

34
#366 - Michel Viktor / @tomkpz

08/11/2021 at 08:29PM

34
#367 - yu xie / @yuxie21997666

09/15/2021 at 10:08AM

34
#368 - Salvador Tojo Quintela / @SalvadorTojo

10/08/2021 at 07:19PM

34
#369 - Brian Asiago / @TheBrianAsiago

08/04/2022 at 05:38PM

34
#370 - Geek Boy / @Geek79

11/08/2022 at 03:43PM

34
#371 - Qishuai Liu / @LiuQishuai

01/09/2023 at 11:35AM

34
#372 - lytoooo0 / @lytoooo0

02/26/2023 at 06:15PM

34
#373 - Dionysus / @user101user

06/14/2023 at 11:43PM

34
#374 - xiang / @xiang56002997

09/05/2023 at 11:06PM

34
#375 - Michael / @openemitter

12/27/2023 at 02:50AM

34
#376 - Peppa Pig / @PeppaPi95550250

04/10/2024 at 05:29AM

34
#377 - luke37842 / @luke37842

05/14/2024 at 09:35PM

34
#378 - menb / @menb111

07/08/2024 at 03:52PM

34
#379 - amberg12 / @amberg12

08/13/2024 at 11:34PM

35
#380 - johnny / @johnnychm

12/29/2010 at 02:12PM

35
#381 - Josh Weinberg / @jcweinberg

12/29/2010 at 07:03PM

35
#382 - Roland Crosby / @roooooland

12/30/2010 at 09:17AM

35
#383 - Asmund / @herrasbe

01/02/2011 at 06:28PM

35
#384 - Avinash Baliga / @avinashbaliga

03/24/2011 at 06:19AM

35
#385 - Nick Klauer / @klauern

05/07/2011 at 04:28AM

35
#386 - Dan Masquelier / @danmasq

07/06/2011 at 09:10PM

35
#387 - Petrik de Heus / @four54

08/24/2011 at 06:17PM

35
#388 - Jyun-Fan Tsai / @fakecolor

02/04/2012 at 01:06PM

35
#389 - Feanor Celebrimbor / @tumbaletaurea

06/04/2012 at 04:35AM

35
#390 - Andrey Yankin / @YankinAndrey

07/20/2012 at 11:11AM