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 by @russellzhaomao:

Unlock 6 remaining solutions by signing in and submitting your own entry
Created by: @ajh_17

247 active golfers, 804 entries

Solutions by @russellzhaomao:
12
#62 - russellzhaomao / @russellzhaomao

06/12/2022 at 03:28AM

13
#>99 - russellzhaomao / @russellzhaomao

06/12/2022 at 03:28AM

14
#>146 - russellzhaomao / @russellzhaomao

06/12/2022 at 03:26AM

15
#>174 - russellzhaomao / @russellzhaomao

06/12/2022 at 03:25AM

16
#>191 - russellzhaomao / @russellzhaomao

06/12/2022 at 03:23AM

34
#>242 - russellzhaomao / @russellzhaomao

06/22/2022 at 12:56PM