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):
15
#151 - Dane Summers / @dsummersl

01/31/2015 at 04:01AM

15
#152 - Sebastian / @soapsurfer

02/14/2015 at 11:22AM

15
#153 - benekeusz / @benekeusz

05/06/2015 at 10:31AM

15
#154 - Lifepillar / @lifepillar

08/14/2015 at 06:07PM

15
#155 - ORchard test / @BilboBrovall

10/26/2015 at 12:02PM

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

10/26/2015 at 07:38PM

15
#157 - Holden Lewis / @lonnez90

12/11/2015 at 07:46PM

15
#158 - Kostas / @blackraven_13

02/26/2016 at 04:03AM

15
#159 - Mister Knister / @vimgolf_ctrl_x

03/18/2016 at 12:43PM

15
#160 - Chenut Ludovic / @7Brwa7

04/01/2016 at 11:43AM

15
#161 - Jeremiah Goyette / @JeremiahGoyette

08/02/2016 at 06:31AM

15
#162 - BareTull / @BareTull3

12/05/2017 at 02:51PM

15
#163 - RockerZZY / @rocker_zzy

06/14/2020 at 06:06AM

15
#164 - ._. / @Katharsic

04/25/2022 at 06:15AM

16
#165 - 親の金でシャンプーを買うな / @jajkeqos

11/22/2014 at 02:25PM

16
#166 - Mattias Fransson / @azzidoos

11/25/2014 at 03:35PM

16
#167 - Bernard Wolff / @bernard_wolff

11/26/2014 at 07:26PM

16
#168 - AA / @stonewareslord

11/26/2014 at 08:08PM

16
#169 - jared swarts / @JaredSwarts

12/13/2014 at 04:58AM

16
#170 - r. / @rmarvie

12/19/2014 at 10:03AM

16
#171 - n/a / @tclamb

01/11/2015 at 08:32PM

16
#172 - xieyh11 / @xieyh11

02/13/2015 at 05:05AM

16
#173 - Andrew Larson / @applarson

04/15/2015 at 01:44PM

16
#174 - chvzvhn / @chvzvhn

04/26/2015 at 04:13PM

16
#175 - James Burns / @James_Ian_Burns

02/16/2016 at 04:51PM

16
#176 - Durga Swaroop Perla / @durgaswaroop

02/21/2016 at 07:54AM

16
#177 - Dinesh Bhosale / @MrDineshBhosale

04/01/2016 at 10:01PM

16
#178 - Denis Kaluznyy / @Spy_Denis

11/13/2017 at 01:09PM

16
#179 - qed / @qed13308565

07/24/2018 at 07:14PM

16
#180 - José / @AngelGaldamez

09/08/2019 at 12:02AM