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):
31
#241 - nickGPT / @nickandbro

08/28/2024 at 04:57AM

33
#242 - Jakob Schöttl / @jschoettl

12/20/2015 at 05:03AM

37
#243 - LSMTD / @LSMTD

12/09/2014 at 03:43AM

40
#244 - 山本悠介 / @yayusuke

11/23/2014 at 09:46AM

40
#245 - Edmundo Perez / @ingedmundo

12/03/2014 at 03:34AM

44
#246 - Filype / @FilypePereira

01/16/2016 at 11:58PM

46
#247 - David English / @Nglish26

02/04/2015 at 03:26AM