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):
14
#121 - Chris Brown / @engineercyb

11/22/2014 at 12:09AM

14
#122 - Carlos López / @morrizon

11/28/2014 at 09:18AM

14
#123 - Michi Loro / @michiloro

12/01/2014 at 01:47PM

14
#124 - Test User / @TestUserIgnore

12/04/2014 at 07:46PM

14
#125 - Daniel Rødskog / @daniero

12/10/2014 at 09:55PM

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

12/16/2014 at 03:00PM

14
#127 - Steve Alison / @Steve_Alison

12/17/2014 at 07:29PM

14
#128 - alex annan / @alexannan

12/30/2014 at 12:00AM

14
#129 - ゆきみ / @edp02

01/01/2015 at 09:18AM

14
#130 - Oliver Christ / @0liverChrist

01/11/2015 at 11:34PM

14
#131 - Aaron Whittington / @whittaaron

01/16/2015 at 02:25PM

14
#132 - Carlos A Henríquez Q / @lagunex

01/17/2015 at 08:21PM

14
#133 - SilentFl / @Silent_Fl

01/26/2015 at 11:44AM

14
#134 - Matt / @mcr05

01/31/2015 at 05:20PM

14
#135 - Thiago Prado / @5k1pp3r

02/22/2015 at 12:56PM

14
#136 - TheProgrammer971 / @tp971

03/14/2015 at 02:05AM

14
#137 - Rolf / @liffon

04/28/2015 at 08:06PM

14
#138 - Clark DuVall / @theclarkatron

05/18/2015 at 06:47AM

14
#139 - Stefan Knudsen / @knud32

06/24/2015 at 02:50AM

14
#140 - Robert Goeddel / @f0rdpr3fect

11/11/2015 at 11:15PM

14
#141 - antew / @antewcode

02/29/2016 at 06:22PM

14
#142 - Ram Tamtam / @ramtamtamtam

06/30/2016 at 08:42AM

14
#143 - TweetDreams / @TweetMusicians

10/15/2016 at 06:32PM

14
#144 - Yann / @yannstad

02/26/2017 at 08:34AM

14
#145 - Brendan B Amdocs / @AmdocsB

09/27/2018 at 05:22PM

14
#146 - Ryan Nevius / @ryannevius

03/25/2020 at 08:15PM

14
#147 - キムラ・OPEL・ユウジ / @kimurayuuji79

11/04/2022 at 03:38AM

14
#148 - 0xf00ff00f / @0xf00ff00f

12/15/2022 at 12:06PM

14
#149 - Иван / @wansmer

04/24/2023 at 05:29PM

14
#150 - かみひろ / @km_hr

03/17/2024 at 08:33AM