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):
56
#91 - James Pringle / @jameskpringle

03/20/2017 at 07:05PM

56
#92 - Jerry Wu / @AzureSpectra

05/05/2017 at 06:11PM

56
#93 - Luke Lee / @luke0201

05/06/2018 at 08:54AM

57
#94 - Eric Nielsen / @ericbn8

08/14/2016 at 04:17AM

57
#95 - Martin Bielik / @MrMadox2

08/16/2016 at 09:51PM

57
#96 - Ashish Narasimham / @asheeshkabob

08/30/2016 at 04:15PM

58
#97 - Jan Liu / @MaglevGankTrain

08/11/2016 at 12:28PM

58
#98 - Etienne Florent / @EtienneFlorent

11/22/2016 at 10:24AM

58
#99 - Anne Pacalet / @_Anne_P

07/10/2017 at 01:03PM

59
#100 - Antoni Villalonga / @friki

08/16/2016 at 11:14AM

59
#101 - Tact Overflow / @muppling

08/19/2016 at 08:14AM

60
#102 - Herbert S. / @herbertshlong

08/12/2016 at 10:36PM

60
#103 - Noud Speijcken / @noudspeijcken

08/18/2016 at 07:59PM

60
#104 - Nico Jansen / @nicojansen1804

01/03/2017 at 06:47PM

60
#105 - Tommaso Leonardi / @tom_leon

05/11/2017 at 02:46PM

61
#106 - Olaf Ole Olafsson / @OlafOleOlafsson

08/12/2016 at 08:53PM

61
#107 - Hans Yelek / @hans_yelek

01/09/2017 at 11:56PM

61
#108 - Adam Kożuch / @adamkozuch

06/12/2017 at 12:52AM

62
#109 - AODQ / @AODQIG

08/20/2016 at 12:19AM

63
#110 - Maxime Reis / @MaximeReis

08/13/2016 at 06:17AM

63
#111 - Andy Balaam / @andybalaam

08/16/2016 at 01:56PM

63
#112 - u03c6 / @u03c6

08/18/2016 at 09:23PM

63
#113 - 張育瑄 / @harry830622

11/24/2016 at 10:30AM

64
#114 - Guillem Blanco / @BlancoGuillem

08/24/2016 at 10:27PM

64
#115 - ILikeVim / @VimIsCool

09/07/2016 at 01:42PM

64
#116 - Chris / @Gaunah_

09/07/2016 at 03:35PM

65
#117 - Albert Mikó / @berci1992

08/25/2016 at 08:34PM

66
#118 - Sahar Rachamim / @SRachamim

09/21/2016 at 04:06PM

66
#119 - Thomas Barusseau / @ThomasBarusseau

12/15/2017 at 03:28PM

67
#120 - Samir Sadek / @netsamir

08/13/2016 at 10:05AM