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):
16
#181 - r. / @rmarvie

12/19/2014 at 10:03AM

16
#182 - n/a / @tclamb

01/11/2015 at 08:32PM

16
#183 - xieyh11 / @xieyh11

02/13/2015 at 05:05AM

16
#184 - Andrew Larson / @applarson

04/15/2015 at 01:44PM

16
#185 - chvzvhn / @chvzvhn

04/26/2015 at 04:13PM

16
#186 - James Burns / @James_Ian_Burns

02/16/2016 at 04:51PM

16
#187 - Durga Swaroop Perla / @durgaswaroop

02/21/2016 at 07:54AM

16
#188 - Dinesh Bhosale / @MrDineshBhosale

04/01/2016 at 10:01PM

16
#189 - Denis Kaluznyy / @Spy_Denis

11/13/2017 at 01:09PM

16
#190 - qed / @qed13308565

07/24/2018 at 07:14PM

16
#191 - Aioriya / @AioriyaDonk

09/08/2019 at 12:02AM

16
#192 - Olivier Bégassat / @zk_evm

06/14/2023 at 08:49PM

17
#193 - Raphael / @rnstlr

12/12/2014 at 05:12PM

17
#194 - d1uckym d1uckym / @d1uckym

12/18/2014 at 10:00PM

17
#195 - Jake Eskel / @JakeEskel

12/29/2014 at 05:13AM

17
#196 - Jeremie / @jermoer

02/08/2015 at 03:36AM

17
#197 - Tom van der Lee / @TomVdLee

04/23/2015 at 12:32PM

17
#198 - Benny Wong / @bdotdub

05/11/2015 at 02:55PM

17
#199 - Hendrik Lammers / @hendriklammers

05/23/2015 at 12:20PM

17
#200 - Bucker Fuskyote / @MooglePower

07/12/2015 at 04:05AM

17
#201 - Will / @obiwan__k3n00bi

08/17/2016 at 04:19AM

17
#202 - Kyouma / @kyoumaJohn

10/14/2016 at 06:48PM

17
#203 - Michał Dytko / @DytkoM

12/23/2016 at 09:04AM

17
#204 - Gurukandhamoorthi / @Gurukandhamoor1

07/11/2017 at 02:50PM

17
#205 - phucvin / @phucvin

02/15/2018 at 04:38AM

17
#206 - steve / @steve35773420

12/01/2022 at 04:52PM

18
#207 - Glauco Pires / @grpires

11/24/2014 at 09:45PM

18
#208 - Nicolas Dascanio / @NicoDascanio

11/25/2014 at 07:40PM

18
#209 - Teemu Okkonen / @TeemuOkkonen

07/13/2015 at 03:19PM

18
#210 - Ivo Blöchliger / @aigledesalpes

08/17/2019 at 11:41AM