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 57ab8b6f621d160fcd000001

C Reformatting

You may use Visual mode... or not. #uppercase

Start file
typedef enum {
   FORMAT_AUDIO_UNKNOWN = 0,
   FORMAT_AUDIO_VORBIS  = 1,
   FORMAT_AUDIO_PCM_U8  = 2,
   FORMAT_AUDIO_PCM_S16LE = 3,
   FORMAT_AUDIO_PCM_S24LE = 4,
   FORMAT_AUDIO_ADPCM_MS = 5, /*!< Microsoft ADPCM */
   FORMAT_AUDIO_AAC = 6,      /*!< Detected but not supported */
   FORMAT_AUDIO_OPUS = 7,     /*!< Xiph Opus */
   FORMAT_AUDIO_NONE = 0x10
} FMT_audio_type;
/* --- */
End file
FMT_AUDIO_TYPE(FORMAT_AUDIO_UNKNOWN, 0);
FMT_AUDIO_TYPE(FORMAT_AUDIO_VORBIS, 1);
FMT_AUDIO_TYPE(FORMAT_AUDIO_PCM_U8, 2);
FMT_AUDIO_TYPE(FORMAT_AUDIO_PCM_S16LE, 3);
FMT_AUDIO_TYPE(FORMAT_AUDIO_PCM_S24LE, 4);
FMT_AUDIO_TYPE(FORMAT_AUDIO_ADPCM_MS, 5);
FMT_AUDIO_TYPE(FORMAT_AUDIO_AAC, 6);
FMT_AUDIO_TYPE(FORMAT_AUDIO_OPUS, 7);
FMT_AUDIO_TYPE(FORMAT_AUDIO_NONE, 0x10);

View Diff

1,12c1,9
< typedef enum {
<    FORMAT_AUDIO_UNKNOWN = 0,
<    FORMAT_AUDIO_VORBIS  = 1,
<    FORMAT_AUDIO_PCM_U8  = 2,
<    FORMAT_AUDIO_PCM_S16LE = 3,
<    FORMAT_AUDIO_PCM_S24LE = 4,
<    FORMAT_AUDIO_ADPCM_MS = 5, /*!< Microsoft ADPCM */
<    FORMAT_AUDIO_AAC = 6,      /*!< Detected but not supported */
<    FORMAT_AUDIO_OPUS = 7,     /*!< Xiph Opus */
<    FORMAT_AUDIO_NONE = 0x10
< } FMT_audio_type;
< /* --- */
---
> FMT_AUDIO_TYPE(FORMAT_AUDIO_UNKNOWN, 0);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_VORBIS, 1);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_PCM_U8, 2);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_PCM_S16LE, 3);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_PCM_S24LE, 4);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_ADPCM_MS, 5);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_AAC, 6);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_OPUS, 7);
> FMT_AUDIO_TYPE(FORMAT_AUDIO_NONE, 0x10);

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 141 remaining solutions by signing in and submitting your own entry
#142 Paul Inc / @hiniol1982 - Score: 156 - 07/13/17 @ 19:31
ddGdk<C-V>gghhhhhhhhhhhIFMT_AUDIO_TYPE(<Esc>f <C-V>lljjjjjjjjd: = <CR>:/<Up>.= /<BS><CR>:%s//, <CR>00ggf,;R);<Esc>j;.j.jl.j/<Esc>.jhhDA);<Esc>jF,lD;lll.A);k<BS><Esc>jDA0<BS>);<Esc>jA0;<BS><BS>);<Esc>kkkkkkkkhhhhkjhxjxZZ

0 comments


Created by: @mcr05

142 active golfers, 559 entries

Leaderboard (lowest score wins):
68
#121 - Christian Guenter / @chris_guenter

08/14/2016 at 06:11PM

68
#122 - Ryan Blais / @reblais

10/14/2016 at 04:18AM

69
#123 - timerella® / @timerella

11/16/2016 at 11:40PM

70
#124 - Matt Walsh / @wattmalsh

02/08/2017 at 12:50AM

71
#125 - Atrament / @Atrament

08/20/2016 at 04:43PM

72
#126 - d1uckym d1uckym / @d1uckym

08/14/2016 at 03:22AM

72
#127 - TweetDreams / @TweetMusicians

10/08/2016 at 11:06AM

73
#128 - marty / @computerliker

05/05/2017 at 03:37AM

74
#129 - Constantine / @ConstantineHatz

09/12/2016 at 09:25PM

74
#130 - Łukasz Daniluk / @lukaszd93

10/01/2016 at 02:44PM

79
#131 - Jurica / @Jurica34581259

11/16/2018 at 03:45PM

82
#132 - Walker Boh / @walker_boh

08/11/2016 at 07:40AM

86
#133 - Felipe Oliveira / @felipecvo

08/17/2016 at 01:33PM

88
#134 - Putente / @Putente_

09/03/2016 at 09:43PM

90
#135 - blizzow / @blizzow

08/14/2016 at 06:20AM

92
#136 - amospalla / @amospalla

08/11/2016 at 03:30PM

93
#137 - PeterGC / @petkusGC

08/12/2016 at 12:08AM

103
#138 - kodemaan / @kodemaan

08/12/2016 at 07:37PM

107
#139 - Jordan Wightman / @tuo2

08/13/2016 at 11:10AM

143
#140 - Michael Brailsford / @brailsmt

08/11/2016 at 03:16PM

149
#141 - Marc / @Fusselgesicht

08/12/2016 at 09:40AM

156
#142 - Paul Inc / @hiniol1982

07/13/2017 at 07:31PM