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):
53
#91 - Mark Dawson / @drmarkdawson

10/24/2016 at 09:39PM

53
#92 - extrintr / @extrintr

01/31/2017 at 11:49PM

53
#93 - Simon Ticks / @SimonTicks

06/10/2018 at 02:35PM

54
#94 - Paul Roe / @ep_roe

08/24/2016 at 07:58AM

54
#95 - nixi3 / @Nixi3cc

09/05/2016 at 04:20AM

55
#96 - Louis Caruana / @louiecaruana

08/11/2016 at 04:49AM

55
#97 - Phoon / @justflashhim

05/11/2019 at 03:30PM

56
#98 - jj johnson / @jcassj1

08/22/2016 at 12:28PM

56
#99 - Cormac Relf / @cormacrelf

09/01/2016 at 01:58PM

56
#100 - James Pringle / @jameskpringle

03/20/2017 at 07:05PM

56
#101 - Jerry Wu / @AzureSpectra

05/05/2017 at 06:11PM

56
#102 - Luke Lee / @luke0201

05/06/2018 at 08:54AM

57
#103 - Eric Nielsen / @ericbn8

08/14/2016 at 04:17AM

57
#104 - Martin Bielik / @MrMadox2

08/16/2016 at 09:51PM

57
#105 - Ashish Narasimham / @asheeshkabob

08/30/2016 at 04:15PM

58
#106 - Jan Liu / @Jagsomarjan

08/11/2016 at 12:28PM

58
#107 - Etienne Florent / @EtienneFlorent

11/22/2016 at 10:24AM

58
#108 - Anne Pacalet / @_Anne_P

07/10/2017 at 01:03PM

59
#109 - Antoni Villalonga / @friki

08/16/2016 at 11:14AM

59
#110 - Tact Overflow / @muppling

08/19/2016 at 08:14AM

60
#111 - Herbert S. / @herbertshlong

08/12/2016 at 10:36PM

60
#112 - Noud Speijcken / @noudspeijcken

08/18/2016 at 07:59PM

60
#113 - Nico Jansen / @nicojansen1804

01/03/2017 at 06:47PM

60
#114 - Tommaso Leonardi / @tom_leon

05/11/2017 at 02:46PM

61
#115 - Olaf Ole Olafsson / @OlafOleOlafsson

08/12/2016 at 08:53PM

61
#116 - Hans Yelek / @hans_yelek

01/09/2017 at 11:56PM

61
#117 - Adam Ko┼╝uch / @adamkozuch

06/12/2017 at 12:52AM

62
#118 - AODQ / @AODQIG

08/20/2016 at 12:19AM

63
#119 - Maxime Reis / @MaximeReis

08/13/2016 at 06:17AM

63
#120 - Andy Balaam / @andybalaam

08/16/2016 at 01:56PM