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):
12
#61 - relastle / @relastle

03/30/2020 at 05:04AM

12
#62 - russellzhaomao / @russellzhaomao

06/12/2022 at 03:28AM

12
#63 - Alex / @AlexanderHeatl2

07/08/2022 at 08:40PM

12
#64 - Janzen / @__Coos

09/28/2022 at 01:21PM

12
#65 - Don'tBeAlarmed / @DontBeAlarmed

05/30/2024 at 06:44AM

12
#66 - Peppa Pig / @PeppaPigSg

07/03/2024 at 03:44AM

13
#67 - Kai Yuan / @kentyuan

11/17/2014 at 12:21PM

13
#68 - Akshay Hegde / @ajh_17

11/18/2014 at 03:23AM

13
#69 - Joel S. / @joelthelion

11/22/2014 at 09:36PM

13
#70 - Vincent Dumoulin / @dumoulinv

11/23/2014 at 05:05AM

13
#71 - John Mahowald / @JohnMahowald

11/25/2014 at 06:54AM

13
#72 - Anderson Mesquita / @andersonvom

12/05/2014 at 06:01PM

13
#73 - Jakob / @jajob

12/16/2014 at 07:46AM

13
#74 - Abdo Achkar / @Achkar

12/18/2014 at 11:28PM

13
#75 - Andrew Leung / @aleungpivotal

12/19/2014 at 08:25PM

13
#76 - Filipe Almeida / @filipe_almeida

12/31/2014 at 04:52AM

13
#77 - Maximiliano Padulo / @mpadulo

01/02/2015 at 10:16PM

13
#78 - low_ghost / @low_ghost_clone

01/17/2015 at 10:27PM

13
#79 - E Both / @enboth

04/08/2015 at 05:28PM

13
#80 - pftb12345 / @pftb12345

04/09/2015 at 12:40PM

13
#81 - we’re going to need a bigger bot / @assaflavie

04/21/2015 at 05:26PM

13
#82 - Victor Haffreingue / @nobe_4

05/19/2015 at 09:17PM

13
#83 - Skúli Jóhannsson / @skulibj

06/26/2015 at 08:17PM

13
#84 - Kirill Cherkashin / @kirjs

09/20/2015 at 03:00PM

13
#85 - Ben Vandervalk / @benvvalk

09/21/2015 at 04:02AM

13
#86 - Ryan Marcotte / @ryanjmarcotte

11/15/2015 at 03:26PM

13
#87 - Jon Krause / @jkrause314

12/30/2015 at 06:33AM

13
#88 - Dimitar Dimitrov / @kurkale6ka

03/14/2016 at 05:04PM

13
#89 - Andres Araya / @arayaandresfco

05/29/2016 at 03:32PM

13
#90 - Vaisian / @Vaisian

07/02/2016 at 08:34PM