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 54a94976f4048c00026d8ed6

C to VimDict

Convert a C data structure to a Vimscript dictionary.

Start file
{ "Return", '\n', },
{ "ampersand", '&', },
{ "apostrophe", '\'', },
{ "asciicircum", '^', },
{ "asciitilde", '~', },
{ "asterisk", '*', },
{ "at", '@', },
{ "backslash", '\\', },
End file
{
\  "\n" : 'Return',
\  "&"  : 'ampersand',
\  "\'" : 'apostrophe',
\  "^"  : 'asciicircum',
\  "~"  : 'asciitilde',
\  "*"  : 'asterisk',
\  "@"  : 'at',
\  "\\" : 'backslash',
\}

View Diff

1,8c1,10
< { "Return", '\n', },
< { "ampersand", '&', },
< { "apostrophe", '\'', },
< { "asciicircum", '^', },
< { "asciitilde", '~', },
< { "asterisk", '*', },
< { "at", '@', },
< { "backslash", '\\', },
---
> {
> \  "\n" : 'Return',
> \  "&"  : 'ampersand',
> \  "\'" : 'apostrophe',
> \  "^"  : 'asciicircum',
> \  "~"  : 'asciitilde',
> \  "*"  : 'asterisk',
> \  "@"  : 'at',
> \  "\\" : 'backslash',
> \}

Solutions by @mnxx:

Unlock 4 remaining solutions by signing in and submitting your own entry
Created by: @xged90

15 active golfers, 53 entries

Solutions by @mnxx:
45
#11 - mnx / @mnxx

01/05/2015 at 08:58AM

46
#>13 - mnx / @mnxx

01/05/2015 at 08:48AM

51
#>14 - mnx / @mnxx

01/05/2015 at 08:43AM

53
#>15 - mnx / @mnxx

01/05/2015 at 08:39AM