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

0 comments


Created by: @ajh_17

247 active golfers, 804 entries

Leaderboard (lowest score wins):
18
#211 - Himanshu Tank / @himanshutank75

03/19/2023 at 04:37PM

19
#212 - Ravi S Sinha / @ambidextrousTx

11/17/2014 at 06:45AM

19
#213 - Andy Tockman / @atckmn

11/22/2014 at 01:26PM

19
#214 - Patrick Blesi / @PBlesi

11/25/2014 at 11:40PM

19
#215 - Frank Zhang / @njzyf

12/23/2014 at 08:29PM

19
#216 - Gwilym Kuiper / @gwilymk

01/04/2015 at 02:06PM

19
#217 - David Wright / @David27Wright

01/09/2015 at 06:58PM

19
#218 - Deepak Surti / @dmsurti

03/17/2015 at 12:42PM

19
#219 - shugen / @shugeno

03/17/2015 at 09:53PM

19
#220 - albalitz / @_albalitz

06/07/2019 at 08:18AM

20
#221 - aaron sullivan / @aaronsull

11/27/2014 at 08:36AM

20
#222 - allenxuyb / @allenxuyb

12/26/2014 at 05:07AM

20
#223 - x03n046 / @x03n046

06/06/2022 at 05:58AM

21
#224 - Jesse Francis / @tietusc

11/20/2014 at 03:00AM

21
#225 - Sam B / @samevanbrenner

08/22/2015 at 06:02PM

21
#226 - Ryan van Rensburg / @rdvr001

07/23/2016 at 11:25AM

21
#227 - Austin Ware / @AustinWare17

03/12/2018 at 09:30PM

22
#228 - Adrien Fabre / @statox42

05/19/2015 at 08:58PM

23
#229 - Pierre Houssin / @PierreHoussin

12/06/2014 at 04:42PM

23
#230 - Kamil Laskowski / @laskowskikamil

03/21/2015 at 09:09AM

24
#231 -  River / @glacialrd

11/21/2014 at 10:23AM

24
#232 - Christopher Brew / @Seph1rothVII

12/02/2014 at 12:37AM

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

09/07/2015 at 10:11PM

25
#234 - Andrew / @a0di

11/06/2024 at 07:23PM

26
#235 - Jan Novak / @odpadnimail

11/18/2014 at 09:36PM

28
#236 - Jurica / @Jurica34581259

11/16/2018 at 05:19PM

28
#237 - 김범준 / @kmbmjn

05/11/2021 at 05:22AM

29
#238 - André Peric Tavares / @AndrePeric

07/31/2016 at 05:03PM

31
#239 - Aaron / @_Lordofthevoid_

12/09/2019 at 07:08AM

31
#240 - @grhkm@infosec.exchange / @grhkm21

12/20/2022 at 01:56PM