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):
13
#91 - Alex Linden / @alexwlinden1

04/20/2017 at 07:12PM

13
#92 - PL / @petrlaitoch

05/16/2017 at 10:39AM

13
#93 - Ben Hill / @KaizenSoze70

02/11/2018 at 10:08PM

13
#94 - DHM / @DHM29978992

04/28/2018 at 09:50PM

13
#95 - name / @name65894813

11/26/2018 at 03:33PM

13
#96 - Mihai / @mihaicristiant

12/27/2018 at 12:40PM

13
#97 - Lory / @Lory46845742

11/20/2019 at 01:21PM

13
#98 - Michel Viktor / @tomkpz

07/27/2021 at 05:39AM

13
#99 - Jean George / @JeanGeo20504212

01/06/2022 at 11:27PM

13
#100 - Berel94 / @Berel94

03/25/2024 at 09:55PM

13
#101 - Brice Bischoff / @B-Bischoff

11/08/2024 at 10:21AM

14
#102 - Eduardo / @earada

11/17/2014 at 07:52AM

14
#103 - mnx / @mnxx

11/17/2014 at 01:00PM

14
#104 - Haitao Li / @lihaitao

11/17/2014 at 03:24PM

14
#105 - Federico Ramirez / @gosukiwi

11/17/2014 at 03:38PM

14
#106 - Marcelo Montu / @_mMontu_

11/17/2014 at 03:59PM

14
#107 - Thomas Geßler / @th_gessler

11/17/2014 at 07:34PM

14
#108 - Steve Tjoa / @stevetjoa

11/17/2014 at 10:05PM

14
#109 - Caek / @Caek_

11/17/2014 at 11:47PM

14
#110 - Marcin Radomski / @_dextero

11/18/2014 at 03:52PM

14
#111 - CJ Avilla / @cjav_dev

11/18/2014 at 04:37PM

14
#112 - Benjamin Frölich / @kakazwerglein

11/18/2014 at 09:21PM

14
#113 - Zapata / @Incredible_JFP

11/18/2014 at 09:51PM

14
#114 - Erik Buček / @_EnterNameHere_

11/19/2014 at 09:02AM

14
#115 - Philip Ince / @philipince

11/19/2014 at 06:55PM

14
#116 - Tiago Royer / @royertiago

11/20/2014 at 02:22AM

14
#117 - kungfuchad / @kungfuchad

11/20/2014 at 12:54PM

14
#118 - Bart / @oneofmanybarts

11/20/2014 at 01:34PM

14
#119 - Josu Oyanguren / @josuoyanguren

11/21/2014 at 09:47AM

14
#120 - Mauro Persano / @fzort

11/21/2014 at 02:35PM