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


#163 nickGPT / @nickandbro - Score: 156 - 08/28/24 @ 03:05
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

163 active golfers, 690 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

30
#16 - Dax / @zacoxi

11/14/2018 at 11:07AM

30
#17 - alekfed / @alek_fed

04/15/2019 at 06:04PM

30
#18 - Grant / @grant_7788

05/17/2019 at 06:24AM

30
#19 - John Braxler / @braxler

06/18/2019 at 03:53PM

30
#20 - majo senf / @majo_senf

06/19/2019 at 02:22PM

30
#21 - Miłosz Łakomy / @foobar01123

11/11/2019 at 12:04PM

30
#22 - Kevin Keefe / @KevinKeefe5

06/16/2020 at 06:51PM

30
#23 - Topvimgolf Score / @topvimgolfscore

07/28/2023 at 12:25PM

30
#24 - Peppa Pig / @PeppaPigSg

06/28/2024 at 06:03AM

32
#25 - "Smylers" / @Smylers2

08/12/2016 at 04:41AM

32
#26 - Andrew Smith / @amazing_andrew

08/14/2016 at 12:59AM

32
#27 - Richard O'Brien / @richard0b

08/18/2016 at 03:42AM

32
#28 - Ivan De Dios / @IvantheDugtrio

08/22/2016 at 05:04AM

32
#29 - hyhit / @hyhit2

08/22/2016 at 08:59AM

32
#30 - jaresty / @jaresty

08/22/2016 at 03:19PM