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):
41
#61 - towc / @MateiCopot

07/08/2018 at 12:28PM

43
#62 - Rosalie Tolentino / @rosatolen

08/14/2016 at 11:49PM

43
#63 - jn / @j1357924

08/23/2016 at 07:44PM

43
#64 - Raymond Chang / @raymond743209

04/27/2017 at 07:34AM

44
#65 - Sarang Khim / @sarang_khim

08/12/2016 at 06:06AM

44
#66 - ♜ Pepe Doval / @pepellou

08/29/2016 at 10:50PM

44
#67 - ✘A / @Lolicon_H

09/18/2016 at 04:08AM

44
#68 - Christophe Perrotin / @ChrisPerSurTwit

09/24/2016 at 10:29PM

44
#69 - Social Botolinum / @SocialBot4

01/25/2017 at 01:15PM

45
#70 - h3is3nd3rp / @h3is3nd3rp

08/05/2018 at 07:27PM

46
#71 - Gurukandhamoorthi / @Gurukandhamoor1

07/10/2017 at 02:04PM

46
#72 - PCS Solutions / @PeteSolutions

08/20/2018 at 09:58PM

46
#73 - Vladimir Leskov / @vladimirlesk

11/25/2019 at 11:25PM

47
#74 - Ben Hill / @KaizenSoze70

10/19/2017 at 05:25PM

48
#75 - oscar / @zonza_mas

09/09/2016 at 02:01PM

48
#76 - Ivo Blöchliger / @aigledesalpes

08/10/2019 at 07:22PM

49
#77 - exp977 / @exp977

08/12/2016 at 02:03PM

49
#78 - Alexandre Jasmin / @ajasmin

02/19/2017 at 04:41PM

50
#79 - f00b8tr / @f00b8tr5

08/20/2016 at 05:40AM

50
#80 - Carl Egbert / @CarlOEgbert

06/11/2017 at 08:36PM

51
#81 - some call me mattp / @mattpep

08/11/2016 at 11:39AM

51
#82 - antoine biard / @biard_antoine

08/29/2016 at 03:19PM

51
#83 - Utkrisht Dhankar / @UtkrishtDhankar

09/07/2016 at 03:02PM

51
#84 - Josef S / @fofefs

09/15/2016 at 12:24PM

51
#85 - Christian Rondeau / @c_rondeau

10/16/2016 at 04:05AM

51
#86 - Chris Cummings / @mistahcummings

10/31/2016 at 02:27AM

51
#87 - Marin Usalj / @_supermarin

11/10/2016 at 12:23AM

51
#88 - Hannu Lounento / @hlounent

12/19/2016 at 07:12PM

51
#89 - Ariel Miculas / @ArielMiculas

09/24/2019 at 03:46PM

53
#90 - Daniele Oriani / @DanieleOriani

09/02/2016 at 08:18PM