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):
17
#181 - Raphael / @rnstlr

12/12/2014 at 05:12PM

17
#182 - d1uckym d1uckym / @d1uckym

12/18/2014 at 10:00PM

17
#183 - Jake Eskel / @JakeEskel

12/29/2014 at 05:13AM

17
#184 - Jeremie / @jermoer

02/08/2015 at 03:36AM

17
#185 - Tom van der Lee / @TomVdLee

04/23/2015 at 12:32PM

17
#186 - Benny Wong / @bdotdub

05/11/2015 at 02:55PM

17
#187 - Hendrik Lammers / @hendriklammers

05/23/2015 at 12:20PM

17
#188 - Bucker Fuskyote / @MooglePower

07/12/2015 at 04:05AM

17
#189 - Will / @obiwan__k3n00bi

08/17/2016 at 04:19AM

17
#190 - Kyouma / @kyoumaJohn

10/14/2016 at 06:48PM

17
#191 - Michał Dytko / @DytkoM

12/23/2016 at 09:04AM

17
#192 - Gurukandhamoorthi / @Gurukandhamoor1

07/11/2017 at 02:50PM

17
#193 - phucvin / @phucvin

02/15/2018 at 04:38AM

18
#194 - Glauco Pires / @grpires

11/24/2014 at 09:45PM

18
#195 - Nicolas Dascanio / @NicoDascanio

11/25/2014 at 07:40PM

18
#196 - Teemu Okkonen / @TeemuOkkonen

07/13/2015 at 03:19PM

18
#197 - Ivo Blöchliger / @aigledesalpes

08/17/2019 at 11:41AM

19
#198 - Ravi S Sinha / @ambidextrousTx

11/17/2014 at 06:45AM

19
#199 - Keyboard Fire / @KeyboardFire

11/22/2014 at 01:26PM

19
#200 - Patrick Blesi / @PBlesi

11/25/2014 at 11:40PM

19
#201 - Frank Zhang / @njzyf

12/23/2014 at 08:29PM

19
#202 - Gwilym Kuiper / @gwilymk

01/04/2015 at 02:06PM

19
#203 - David Wright / @David27Wright

01/09/2015 at 06:58PM

19
#204 - Deepak Surti / @dmsurti

03/17/2015 at 12:42PM

19
#205 - shugen / @shugeno

03/17/2015 at 09:53PM

19
#206 - albalitz / @_albalitz

06/07/2019 at 08:18AM

20
#207 - aaron sullivan / @aaronsull

11/27/2014 at 08:36AM

20
#208 - allenxuyb / @allenxuyb

12/26/2014 at 05:07AM

20
#209 - x03n046 / @x03n046

06/06/2022 at 05:58AM

21
#210 - Jesse Francis / @tietusc

11/20/2014 at 03:00AM