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):
13
#91 - name / @name65894813

11/26/2018 at 03:33PM

13
#92 - Mihai / @mihaicristiant

12/27/2018 at 12:40PM

13
#93 - Lory / @Lory46845742

11/20/2019 at 01:21PM

13
#94 - Michel Viktor / @tomkpz

07/27/2021 at 05:39AM

13
#95 - Jean George / @JeanGeo20504212

01/06/2022 at 11:27PM

14
#96 - Eduardo / @earada

11/17/2014 at 07:52AM

14
#97 - mnx / @mnxx

11/17/2014 at 01:00PM

14
#98 - Haitao Li / @lihaitao

11/17/2014 at 03:24PM

14
#99 - Federico Ramirez / @gosukiwi

11/17/2014 at 03:38PM

14
#100 - Marcelo Montu / @_mMontu_

11/17/2014 at 03:59PM

14
#101 - Thomas Geßler / @th_gessler

11/17/2014 at 07:34PM

14
#102 - Steve Tjoa / @stevetjoa

11/17/2014 at 10:05PM

14
#103 - Caek / @Caek_

11/17/2014 at 11:47PM

14
#104 - Marcin Radomski / @_dextero

11/18/2014 at 03:52PM

14
#105 - CJ Avilla / @wizemanip

11/18/2014 at 04:37PM

14
#106 - Benjamin Frölich / @kakazwerglein

11/18/2014 at 09:21PM

14
#107 - Zapata / @Incredible_JFP

11/18/2014 at 09:51PM

14
#108 - Erik Buček / @_EnterNameHere_

11/19/2014 at 09:02AM

14
#109 - Philip Ince / @philipince

11/19/2014 at 06:55PM

14
#110 - Tiago Royer / @royertiago

11/20/2014 at 02:22AM

14
#111 - kungfuchad / @kungfuchad

11/20/2014 at 12:54PM

14
#112 - Bart / @oneofmanybarts

11/20/2014 at 01:34PM

14
#113 - Josu Oyanguren / @josuoyanguren

11/21/2014 at 09:47AM

14
#114 - Mauro Persano / @fzort

11/21/2014 at 02:35PM

14
#115 - Chris Brown / @engineercyb

11/22/2014 at 12:09AM

14
#116 - Carlos López / @morrizon

11/28/2014 at 09:18AM

14
#117 - Michi Loro / @michiloro

12/01/2014 at 01:47PM

14
#118 - Test User / @TestUserIgnore

12/04/2014 at 07:46PM

14
#119 - Daniel Rødskog / @daniero

12/10/2014 at 09:55PM

14
#120 - 1upまむ9 / @mamunine

12/16/2014 at 03:00PM