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):
14
#121 - Steve Alison / @Steve_Alison

12/17/2014 at 07:29PM

14
#122 - alex annan / @alexannan

12/30/2014 at 12:00AM

14
#123 - ゆきみ / @edp02

01/01/2015 at 09:18AM

14
#124 - Oliver Christ / @0liverChrist

01/11/2015 at 11:34PM

14
#125 - Aaron Whittington / @whittaaron

01/16/2015 at 02:25PM

14
#126 - Carlos A Henríquez Q / @lagunex

01/17/2015 at 08:21PM

14
#127 - SilentFl / @Silent_Fl

01/26/2015 at 11:44AM

14
#128 - Matt / @mcr05

01/31/2015 at 05:20PM

14
#129 - Thiago Prado / @5k1pp3r

02/22/2015 at 12:56PM

14
#130 - TheProgrammer971 / @tp971

03/14/2015 at 02:05AM

14
#131 - Rolf / @liffon

04/28/2015 at 08:06PM

14
#132 - Clark DuVall / @theclarkatron

05/18/2015 at 06:47AM

14
#133 - Stefan Knudsen / @knud32

06/24/2015 at 02:50AM

14
#134 - Robert Goeddel / @f0rdpr3fect

11/11/2015 at 11:15PM

14
#135 - antew / @antewcode

02/29/2016 at 06:22PM

14
#136 - Ram Tamtam / @ramtamtamtam

06/30/2016 at 08:42AM

14
#137 - TweetDreams / @TweetMusicians

10/15/2016 at 06:32PM

14
#138 - Yann / @yannstad

02/26/2017 at 08:34AM

14
#139 - Brendan B Amdocs / @AmdocsB

09/27/2018 at 05:22PM

14
#140 - Ryan Nevius / @ryannevius

03/25/2020 at 08:15PM

15
#141 - Tibor Claassen / @codebeige

11/17/2014 at 07:24AM

15
#142 - Matt Robbins / @mcrmfc

11/17/2014 at 09:20AM

15
#143 - Davit Samvelyan / @DavitSamvelyan

11/17/2014 at 11:32AM

15
#144 - James / @Dronak

11/17/2014 at 12:52PM

15
#145 - Yuriy / @skriyka

11/18/2014 at 03:22PM

15
#146 - Harold Pong / @har2po

11/19/2014 at 01:37PM

15
#147 - Alexandre Jouandin / @Allezxandre

11/19/2014 at 07:52PM

15
#148 - Vivus Ignis / @vivus_ignis

11/23/2014 at 08:38PM

15
#149 - Elizabeth / @sprinkles418

12/13/2014 at 12:02AM

15
#150 - Eric Biven / @EricBiven

12/31/2014 at 10:19PM