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):
15
#151 - Tibor Claassen / @codebeige

11/17/2014 at 07:24AM

15
#152 - Matt Robbins / @mcrmfc

11/17/2014 at 09:20AM

15
#153 - Davit Samvelyan / @DavitSamvelyan

11/17/2014 at 11:32AM

15
#154 - James / @Dronak

11/17/2014 at 12:52PM

15
#155 - Yuriy / @skriyka

11/18/2014 at 03:22PM

15
#156 - Harold Pong / @har2po

11/19/2014 at 01:37PM

15
#157 - Alexandre Jouandin / @Allezxandre

11/19/2014 at 07:52PM

15
#158 - Vivus Ignis / @vivus_ignis

11/23/2014 at 08:38PM

15
#159 - Elizabeth / @sprinkles418

12/13/2014 at 12:02AM

15
#160 - Eric Biven / @EricBiven

12/31/2014 at 10:19PM

15
#161 - Dane Summers / @dsummersl

01/31/2015 at 04:01AM

15
#162 - Sebastian / @soapsurfer

02/14/2015 at 11:22AM

15
#163 - benekeusz / @benekeusz

05/06/2015 at 10:31AM

15
#164 - Lifepillar / @lifepillar

08/14/2015 at 06:07PM

15
#165 - ORchard test / @BilboBrovall

10/26/2015 at 12:02PM

15
#166 - Bogumił Kamiński / @BogumilKaminski

10/26/2015 at 07:38PM

15
#167 - Holden Lewis / @lonnez90

12/11/2015 at 07:46PM

15
#168 - Kostas / @blackraven_13

02/26/2016 at 04:03AM

15
#169 - Mister Knister / @vimgolf_ctrl_x

03/18/2016 at 12:43PM

15
#170 - Chenut Ludovic / @7Brwa7

04/01/2016 at 11:43AM

15
#171 - Jeremiah Goyette / @JeremiahGoyette

08/02/2016 at 06:31AM

15
#172 - BareTull / @BareTull3

12/05/2017 at 02:51PM

15
#173 - RockerZZY / @rocker_zzy

06/14/2020 at 06:06AM

15
#174 - ._. / @Katharsic

04/25/2022 at 06:15AM

15
#175 - James Marshall / @astrophd

10/21/2022 at 03:17AM

16
#176 - Yu SERIZAWA / @upamune

11/22/2014 at 02:25PM

16
#177 - Mattias Fransson / @azzidoos

11/25/2014 at 03:35PM

16
#178 - Bernard Wolff / @bernard_wolff

11/26/2014 at 07:26PM

16
#179 - AA / @stonewareslord

11/26/2014 at 08:08PM

16
#180 - jared swarts / @JaredSwarts

12/13/2014 at 04:58AM