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
#241 - russellzhaomao / @russellzhaomao

05/25/2022 at 02:22AM

33
#242 - josh / @_zvjos

06/18/2022 at 12:34PM

33
#243 - Andreas Näsman / @andreas_nasman

06/19/2022 at 06:30PM

33
#244 - Qing Liu / @poeminlash

06/29/2022 at 05:25AM

33
#245 - Alex / @AlexanderHeatl2

07/05/2022 at 05:48PM

33
#246 - Robert Newey / @wiseassbogan

07/09/2022 at 06:22AM

33
#247 - anakojm / @anakojm

07/13/2022 at 11:13PM

33
#248 - Gabriele / @lazygeb

08/04/2022 at 05:36PM

33
#249 - Plicatibu / @plicatibu

08/13/2022 at 07:51PM

33
#250 - Janzen / @__Coos

09/15/2022 at 07:48AM

33
#251 - 刘宏亮 / @AkeyCoy

09/24/2022 at 01:48PM

33
#252 - math is what I hate / @mpnmbn

10/29/2022 at 06:11PM

33
#253 - dadams2 / @dadams217

11/25/2022 at 07:44AM

33
#254 - Zion Park / @zionpark93

12/15/2022 at 11:51AM

33
#255 - Александр Моисеев / @Aleksan43607471

01/20/2023 at 11:22AM

33
#256 - Sam Unicomb / @samuelunicomb

01/21/2023 at 01:42PM

33
#257 - Adigan / @Addigan

05/13/2023 at 11:54AM

33
#258 - Topvimgolf Score / @topvimgolfscore

05/27/2023 at 06:57AM

33
#259 - Golf Vim / @GolfVim11388

07/01/2023 at 12:07AM

33
#260 - Gs Abl / @gs_abl

07/08/2023 at 03:42PM

33
#261 - Chris Atanasian / @chrisatanasian

11/17/2023 at 09:13PM

33
#262 - rlykins728 / @rlykins728

11/25/2023 at 02:29AM

33
#263 - lethalNeutrino / @lethalNeutrino

11/28/2023 at 01:33PM

33
#264 - Remus Dalrymple / @bornintheflames

12/13/2023 at 08:26PM

33
#265 - 5S-MOHAMED-SHABAIK / @5S-MOHAMED-SHABAIK

01/15/2024 at 09:23AM

33
#266 - 5S-BENDEGUZ-HORVATH / @5S-BENDEGUZ-HORVATH

01/15/2024 at 12:13PM

33
#267 - 5S-LIVIUSZ-SZALMA / @5S-LIVIUSZ-SZALMA

01/15/2024 at 12:14PM

33
#268 - k84d / @k84d

01/29/2024 at 07:49PM

33
#269 - maxdarling / @maxdarling

02/03/2024 at 06:41PM

33
#270 - Simo Kivistö / @kivissimo

02/07/2024 at 07:03PM