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):
32
#31 - hor1ace / @hor3ace

09/07/2016 at 01:29PM

32
#32 - Anthony Ardito / @aardito21

09/26/2016 at 12:41AM

32
#33 - manbogot / @gmanbor

10/02/2016 at 08:11AM

32
#34 - trx / @trxdbg

10/11/2016 at 12:31AM

32
#35 - Bill Ruddock / @biinari

10/31/2016 at 01:51AM

32
#36 - i1464083 / @i1464083

11/18/2016 at 01:32PM

32
#37 - 20speedvegan / @ashkevinm

04/12/2017 at 07:47PM

32
#38 - harpocrates744 / @harpocrates744

09/05/2017 at 10:07PM

33
#39 - Jon Krause / @jkrause314

08/11/2016 at 04:29PM

33
#40 - Pedro Santos / @pedrosans

08/12/2016 at 04:09AM

33
#41 - Marcin Radomski / @_dextero

08/12/2016 at 08:12AM

33
#42 - 박 재 성 / @javajigi

09/24/2016 at 02:24AM

33
#43 - Zhihong Liu / @pieapple03

02/11/2017 at 12:11PM

33
#44 - Daniel / @Daniel00288663

03/17/2017 at 12:49PM

33
#45 - xer0.5ive / @Bibekshah

07/09/2018 at 04:17PM

35
#46 - Matthieu Crapet / @mcr05

08/14/2016 at 08:15AM

35
#47 - Jeremiah Goyette / @JeremiahGoyette

08/20/2016 at 04:56AM

38
#48 - Marcel Akkerman / @MarcelAkkerman

12/21/2016 at 07:13PM

39
#49 - Lifepillar / @lifepillar

08/17/2016 at 04:36PM

40
#50 - 赤佐田奈葉 / @akasatanaha_

06/22/2018 at 07:33AM

41
#51 - Cristian Lupașcu / @clupasq

08/11/2016 at 07:00AM

41
#52 - Krzysztof Borkowski / @smiechowy

09/02/2016 at 10:27PM

41
#53 - Sarin Durong / @Sarin4Du

12/12/2016 at 01:39AM

41
#54 - kkh / @kkhdlut

06/15/2017 at 04:24PM

41
#55 - towc / @MateiCopot

07/08/2018 at 12:28PM

42
#56 - Foo Bar / @foobar01123

08/16/2016 at 09:31AM

43
#57 - Rosalie Tolentino / @rosatolen

08/14/2016 at 11:49PM

43
#58 - jn / @j1357924

08/23/2016 at 07:44PM

43
#59 - Raymond Chang / @raymond743209

04/27/2017 at 07:34AM

44
#60 - Sarang Khim / @sarang_khim

08/12/2016 at 06:06AM