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):
44
#61 - ♜ Pepe Doval / @pepellou

08/29/2016 at 10:50PM

44
#62 - ✘A / @Lolicon_H

09/18/2016 at 04:08AM

44
#63 - Christophe Perrotin / @ChrisPerSurTwit

09/24/2016 at 10:29PM

44
#64 - Social Botolinum / @SocialBot4

01/25/2017 at 01:15PM

45
#65 - h3is3nd3rp / @h3is3nd3rp

08/05/2018 at 07:27PM

46
#66 - Gurukandhamoorthi / @Gurukandhamoor1

07/10/2017 at 02:04PM

46
#67 - PCS Solutions / @PeteSolutions

08/20/2018 at 09:58PM

47
#68 - Ben Hill / @KaizenSoze70

10/19/2017 at 05:25PM

48
#69 - oscar / @zonza_mas

09/09/2016 at 02:01PM

49
#70 - exp977 / @exp977

08/12/2016 at 02:03PM

49
#71 - Alexandre Jasmin / @ajasmin

02/19/2017 at 04:41PM

50
#72 - f00b8tr / @f00b8tr5

08/20/2016 at 05:40AM

50
#73 - Carl Egbert / @CarlOEgbert

06/11/2017 at 08:36PM

51
#74 - some call me mattp / @mattpep

08/11/2016 at 11:39AM

51
#75 - antoine biard / @biard_antoine

08/29/2016 at 03:19PM

51
#76 - Utkrisht Dhankar / @UtkrishtDhankar

09/07/2016 at 03:02PM

51
#77 - Josef S / @fofefs

09/15/2016 at 12:24PM

51
#78 - Christian Rondeau / @c_rondeau

10/16/2016 at 04:05AM

51
#79 - Chris Cummings / @mistahcummings

10/31/2016 at 02:27AM

51
#80 - Marin Usalj / @_supermarin

11/10/2016 at 12:23AM

51
#81 - Hannu Lounento / @hlounent

12/19/2016 at 07:12PM

53
#82 - Daniele Oriani / @DanieleOriani

09/02/2016 at 08:18PM

53
#83 - Mark Dawson / @drmarkdawson

10/24/2016 at 09:39PM

53
#84 - extrintr / @extrintr

01/31/2017 at 11:49PM

53
#85 - Simon Ticks / @SimonTicks

06/10/2018 at 02:35PM

54
#86 - Paul Roe / @ep_roe

08/24/2016 at 07:58AM

54
#87 - nixi3 / @Nixi3cc

09/05/2016 at 04:20AM

55
#88 - Louis Caruana / @louiecaruana

08/11/2016 at 04:49AM

56
#89 - jj johnson / @jcassj1

08/22/2016 at 12:28PM

56
#90 - Cormac Relf / @cormacrelf

09/01/2016 at 01:58PM