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 54698da795f6da00020d85ed

Condensed Cases

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

Start file
enum PlaybackRequestType {
    case Next
    case Previous
    case Play
    case Stop
}
End file
enum PlaybackRequestType {
    case Next, Previous, Play, Stop
}

View Diff

2,5c2
<     case Next
<     case Previous
<     case Play
<     case Stop
---
>     case Next, Previous, Play, Stop

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 229 remaining solutions by signing in and submitting your own entry
#230 David English / @Nglish26 - Score: 46 - 02/04/15 @ 03:26
jj3ddklllllllllllla, Previous, p<BS>Play, Stop<Esc>ZZ

0 comments


Created by: @ajh_17

230 active golfers, 752 entries

Leaderboard (lowest score wins):
12
#31 - Ferdev vimgolf / @fergvimgolf

08/12/2015 at 08:25AM

12
#32 - Liam Thurston / @lthurston188

08/18/2015 at 04:35AM

12
#33 - Mike Adams / @davis_cromwell

10/02/2015 at 04:48PM

12
#34 - Walker Boh / @walker_boh

10/05/2015 at 12:49PM

12
#35 - Pin / @ponfelipon

10/18/2015 at 02:22AM

12
#36 - ハチポケッツ / @8pockets

11/26/2015 at 12:24AM

12
#37 - Wilmer Bandres / @WilmerBandres

12/14/2015 at 06:25PM

12
#38 - Strabs / @artistavenue

01/13/2016 at 10:42AM

12
#39 - jackliusr / @jackliusr

01/14/2016 at 04:45AM

12
#40 - Aleksey Zhidkov / @AlexeyZhidkov

02/10/2016 at 04:05AM

12
#41 - Roberto Carraretto / @robcarraretto

02/21/2016 at 05:25PM

12
#42 - ben kavanagh / @bkava

02/24/2016 at 01:28AM

12
#43 - John Smith / @literacyisgood

03/29/2016 at 06:28PM

12
#44 - Stephen Aument / @saument

09/06/2016 at 03:32AM

12
#45 - jdupont655 / @jdupont655

09/06/2016 at 01:52PM

12
#46 - trx / @trxdbg

10/24/2016 at 08:57AM

12
#47 - Daniel / @Daniel00288663

03/30/2017 at 01:00PM

12
#48 - akanb / @GAkt6L6SlKhy8zA

06/28/2017 at 03:30AM

12
#49 - Turkey Man / @lvturkeyman

11/19/2017 at 05:29AM

12
#50 - BarbaJol / @drpproteus

01/07/2018 at 11:46AM

12
#51 - Arijus / @argshook

05/04/2018 at 08:24AM

12
#52 - Daniël De Koker / @daniel_koker

07/12/2018 at 08:51AM

12
#53 - Dax / @zacoxi

12/04/2018 at 01:25AM

12
#54 - alekfed / @alek_fed

04/16/2019 at 09:31AM

12
#55 - majo senf / @majo_senf

06/21/2019 at 01:14PM

12
#56 - Vimfiz / @vimfiz

07/11/2019 at 12:49AM

12
#57 - Melvin Cheung / @MelvinCheung

11/12/2019 at 04:02AM

12
#58 - Viktor Styrud / @ViktorStyrud

11/29/2019 at 08:04AM

12
#59 - Miłosz Łakomy / @foobar01123

12/13/2019 at 09:50AM

12
#60 - Julien IsCool / @IscoolJulien

01/20/2020 at 06:16PM