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 151 remaining solutions by signing in and submitting your own entry
#152 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

152 active golfers, 654 entries

Leaderboard (lowest score wins):
32
#31 - jdupont655 / @jdupont655

09/01/2016 at 11:01PM

32
#32 - ymmtmdk / @ymmtmdk

09/04/2016 at 08:52AM

32
#33 - loki2441 / @loki2441

09/05/2016 at 09:40AM

32
#34 - Peter / @sunirbmag

09/05/2016 at 08:45PM

32
#35 - hor1ace / @hor3ace

09/07/2016 at 01:29PM

32
#36 - Anthony Ardito / @aardito21

09/26/2016 at 12:41AM

32
#37 - manbogot / @gmanbor

10/02/2016 at 08:11AM

32
#38 - trx / @trxdbg

10/11/2016 at 12:31AM

32
#39 - Bill Ruddock / @biinari

10/31/2016 at 01:51AM

32
#40 - i1464083 / @i1464083

11/18/2016 at 01:32PM

32
#41 - 20speedvegan / @ashkevinm

04/12/2017 at 07:47PM

32
#42 - harpocrates744 / @harpocrates744

09/05/2017 at 10:07PM

32
#43 - name / @name65894813

11/22/2018 at 10:35PM

32
#44 - Mihai / @mihaicristiant

12/10/2018 at 07:33AM

33
#45 - Jon Krause / @jkrause314

08/11/2016 at 04:29PM

33
#46 - Pedro Santos / @pedrosans

08/12/2016 at 04:09AM

33
#47 - Marcin Radomski / @_dextero

08/12/2016 at 08:12AM

33
#48 - 박 재 성 / @javajigi

09/24/2016 at 02:24AM

33
#49 - Zhihong Liu / @pieapple03

02/11/2017 at 12:11PM

33
#50 - Daniel / @Daniel00288663

03/17/2017 at 12:49PM

33
#51 - xer0.5ive / @Bibekshah

07/09/2018 at 04:17PM

35
#52 - Matt / @mcr05

08/14/2016 at 08:15AM

35
#53 - Jeremiah Goyette / @JeremiahGoyette

08/20/2016 at 04:56AM

38
#54 - Marcel Akkerman / @MarcelAkkerman

12/21/2016 at 07:13PM

39
#55 - Lifepillar / @lifepillar

08/17/2016 at 04:36PM

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

06/22/2018 at 07:33AM

41
#57 - Cristian Lupașcu / @clupasq

08/11/2016 at 07:00AM

41
#58 - Krzysztof Borkowski / @smiechowy

09/02/2016 at 10:27PM

41
#59 - Sarin Durong / @Sarin4Du

12/12/2016 at 01:39AM

41
#60 - kkh / @kkhdlut

06/15/2017 at 04:24PM