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 4e9edef5cef4c50001000007

PHP Array Syntax -> MailChimp Merge Syntax

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

Start file
$allowed = array("PIN", "Prefix", "LastName", "FirstName", "MiddleName", 
  "Address1", "Address2", "City", "State", "Zip", "Country", "phone", "mobile",
  "Email", "MothersMaiden", "security1_id", "security1_answer", 
  "security2_id", "security2_answer", "BirthDate", 
  "flag1", "DriversLicense", "gender");
End file
*|PIN|*
*|Prefix|*
*|LastName|*
*|FirstName|*
*|MiddleName|*
*|Address1|*
*|Address2|*
*|City|*
*|State|*
*|Zip|*
*|Country|*
*|phone|*
*|mobile|*
*|Email|*
*|MothersMaiden|*
*|security1_id|*
*|security1_answer|*
*|security2_id|*
*|security2_answer|*
*|BirthDate|*
*|flag1|*
*|DriversLicense|*
*|gender|*

View Diff

1,5c1,23
< $allowed = array("PIN", "Prefix", "LastName", "FirstName", "MiddleName", 
<   "Address1", "Address2", "City", "State", "Zip", "Country", "phone", "mobile",
<   "Email", "MothersMaiden", "security1_id", "security1_answer", 
<   "security2_id", "security2_answer", "BirthDate", 
<   "flag1", "DriversLicense", "gender");
---
> *|PIN|*
> *|Prefix|*
> *|LastName|*
> *|FirstName|*
> *|MiddleName|*
> *|Address1|*
> *|Address2|*
> *|City|*
> *|State|*
> *|Zip|*
> *|Country|*
> *|phone|*
> *|mobile|*
> *|Email|*
> *|MothersMaiden|*
> *|security1_id|*
> *|security1_answer|*
> *|security2_id|*
> *|security2_answer|*
> *|BirthDate|*
> *|flag1|*
> *|DriversLicense|*
> *|gender|*

Solutions by @russellzhaomao:

Unlock 21 remaining solutions by signing in and submitting your own entry
Created by: @meekish

150 active golfers, 545 entries

Solutions by @russellzhaomao:
23
#27 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:15AM

24
#>47 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:10AM

25
#>57 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:07AM

26
#>58 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:07AM

28
#>68 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:06AM

29
#>70 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:05AM

29
#>70 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:29AM

30
#>74 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:05AM

32
#>80 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:04AM

33
#>87 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:02AM

33
#>87 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:03AM

34
#>93 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:01AM

36
#>97 - russellzhaomao / @russellzhaomao

06/01/2022 at 08:00AM

43
#>113 - russellzhaomao / @russellzhaomao

06/01/2022 at 07:58AM

44
#>116 - russellzhaomao / @russellzhaomao

06/01/2022 at 07:57AM

45
#>120 - russellzhaomao / @russellzhaomao

06/01/2022 at 07:53AM

46
#>122 - russellzhaomao / @russellzhaomao

06/01/2022 at 07:51AM

49
#>124 - russellzhaomao / @russellzhaomao

06/01/2022 at 07:50AM

50
#>126 - russellzhaomao / @russellzhaomao

06/01/2022 at 07:45AM

53
#>139 - russellzhaomao / @russellzhaomao

06/01/2022 at 07:43AM

55
#>142 - russellzhaomao / @russellzhaomao

06/01/2022 at 03:08AM