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

03/30/2020 at 05:04AM

12
#62 - russellzhaomao / @russellzhaomao

06/12/2022 at 03:28AM

13
#63 - Kai Yuan / @kentyuan

11/17/2014 at 12:21PM

13
#64 - Akshay Hegde / @ajh_17

11/18/2014 at 03:23AM

13
#65 - Joel S. / @joelthelion

11/22/2014 at 09:36PM

13
#66 - Vincent Dumoulin / @dumoulinv

11/23/2014 at 05:05AM

13
#67 - John Mahowald / @JohnMahowald

11/25/2014 at 06:54AM

13
#68 - Anderson Mesquita / @andersonvom

12/05/2014 at 06:01PM

13
#69 - Jakob / @jajob

12/16/2014 at 07:46AM

13
#70 - Abdo Achkar / @Achkar

12/18/2014 at 11:28PM

13
#71 - Andrew Leung / @aleungpivotal

12/19/2014 at 08:25PM

13
#72 - Filipe Almeida / @filipe_almeida

12/31/2014 at 04:52AM

13
#73 - Maximiliano Padulo / @mpadulo

01/02/2015 at 10:16PM

13
#74 - low_ghost / @low_ghost_clone

01/17/2015 at 10:27PM

13
#75 - E Both / @enboth

04/08/2015 at 05:28PM

13
#76 - pftb12345 / @pftb12345

04/09/2015 at 12:40PM

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

04/21/2015 at 05:26PM

13
#78 - Victor Haffreingue / @nobe_4

05/19/2015 at 09:17PM

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

06/26/2015 at 08:17PM

13
#80 - Kirill Cherkashin / @kirjs

09/20/2015 at 03:00PM

13
#81 - Ben Vandervalk / @benvvalk

09/21/2015 at 04:02AM

13
#82 - Ryan Marcotte / @ryanjmarcotte

11/15/2015 at 03:26PM

13
#83 - Jon Krause / @jkrause314

12/30/2015 at 06:33AM

13
#84 - Dimitar Dimitrov / @kurkale6ka

03/14/2016 at 05:04PM

13
#85 - Andres Araya / @arayaandresfco

05/29/2016 at 03:32PM

13
#86 - Vaisian / @Vaisian

07/02/2016 at 08:34PM

13
#87 - Alex Linden / @alexwlinden1

04/20/2017 at 07:12PM

13
#88 - PL / @petrlaitoch

05/16/2017 at 10:39AM

13
#89 - Ben Hill / @KaizenSoze70

02/11/2018 at 10:08PM

13
#90 - DHM / @DHM29978992

04/28/2018 at 09:50PM