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

140 active golfers, 545 entries

Leaderboard (lowest score wins):
30
#1 - Antony Scriven / @antonyscriven

02/01/2017 at 06:03PM

30
#2 - Saki Gw / @Sakigw

02/01/2017 at 09:01PM

30
#3 - Petro Тrouq / @zulolosi

03/14/2017 at 07:56AM

30
#4 - Alexander Bessonov / @nonsleepr

03/14/2017 at 11:48PM

30
#5 - Ilya Shakirov / @aelaau

03/20/2017 at 03:02PM

30
#6 - Andreas Anderbach / @anderbacha

03/21/2017 at 12:49PM

30
#7 - 梧桐王子 / @WutongYujie

04/26/2017 at 04:57AM

30
#8 - Remus Dalrymple / @bornintheflames

05/05/2017 at 12:31AM

30
#9 - Urtica dioica / @udioica

06/08/2017 at 11:26PM

30
#10 - 杨洋 / @176795444

08/29/2017 at 12:10PM

30
#11 - Turkey Man / @lvturkeyman

11/10/2017 at 04:39PM

30
#12 - Benoit Mortgat / @Benoit_Mortgat

11/14/2017 at 02:39PM

30
#13 - ParasamGateZero / @ParasamGateZero

02/07/2018 at 07:45AM

30
#14 - GreenPinguin / @GreenPinguin2

03/27/2018 at 01:10PM

30
#15 - Daniël De Koker / @daniel_koker

07/02/2018 at 09:17AM

32
#16 - Smylers / @Smylers2

08/12/2016 at 04:41AM

32
#17 - Andrew Smith / @amazing_andrew

08/14/2016 at 12:59AM

32
#18 - John Braxler / @braxler

08/16/2016 at 04:49PM

32
#19 - Richard O'Brien / @richard0b

08/18/2016 at 03:42AM

32
#20 - Ivan De Dios / @IvantheDugtrio

08/22/2016 at 05:04AM

32
#21 - hyhit / @hyhit2

08/22/2016 at 08:59AM

32
#22 - jaresty / @jaresty

08/22/2016 at 03:19PM

32
#23 - Aaron Fresh / @AaronFresh7

08/27/2016 at 12:22PM

32
#24 - Stephen Aument / @saument

08/30/2016 at 06:29PM

32
#25 - Karol Łukaszewicz / @Karolukaszewicz

09/01/2016 at 09:24PM

32
#26 - jdupont655 / @jdupont655

09/01/2016 at 11:01PM

32
#27 - ymmtmdk / @ymmtmdk

09/04/2016 at 08:52AM

32
#28 - loki2441 / @loki2441

09/05/2016 at 09:40AM

32
#29 - Peter / @sunirbmag

09/05/2016 at 08:45PM

32
#30 - hor1ace / @hor3ace

09/07/2016 at 01:29PM