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):
21
#211 - Sam B / @samevanbrenner

08/22/2015 at 06:02PM

21
#212 - Ryan van Rensburg / @rdvr001

07/23/2016 at 11:25AM

21
#213 - Austin Ware / @AustinWare17

03/12/2018 at 09:30PM

22
#214 - Adrien Fabre / @statox42

05/19/2015 at 08:58PM

23
#215 - Pierre Houssin / @PierreHoussin

12/06/2014 at 04:42PM

23
#216 - Kamil Laskowski / @laskowskikamil

03/21/2015 at 09:09AM

24
#217 -  River / @glacialrd

11/21/2014 at 10:23AM

24
#218 - Christopher Brew / @Seph1rothVII

12/02/2014 at 12:37AM

24
#219 - Slobodan Mišković / @slobomiskovic

09/07/2015 at 10:11PM

26
#220 - Jan Novak / @odpadnimail

11/18/2014 at 09:36PM

28
#221 - Jurica / @Jurica34581259

11/16/2018 at 05:19PM

28
#222 - 김범준 / @kmbmjn

05/11/2021 at 05:22AM

29
#223 - André Peric Tavares / @AndrePeric

07/31/2016 at 05:03PM

31
#224 - Aaron / @_Lordofthevoid_

12/09/2019 at 07:08AM

33
#225 - Jakob Schöttl / @jschoettl

12/20/2015 at 05:03AM

37
#226 - LSMTD / @LSMTD

12/09/2014 at 03:43AM

40
#227 - 山本悠介 / @yayusuke

11/23/2014 at 09:46AM

40
#228 - Edmundo Perez / @ingedmundo

12/03/2014 at 03:34AM

44
#229 - Filype / @FilypePereira

01/16/2016 at 11:58PM

46
#230 - David English / @Nglish26

02/04/2015 at 03:26AM