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 @poeminlash:

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

148 active golfers, 507 entries

Solutions by @poeminlash:
23
#28 - Qing Liu / @poeminlash

08/10/2022 at 05:34AM

23
#>28 - Qing Liu / @poeminlash

08/10/2022 at 05:35AM

23
#>28 - Qing Liu / @poeminlash

08/10/2022 at 05:37AM

24
#>45 - Qing Liu / @poeminlash

08/10/2022 at 05:33AM

25
#>55 - Qing Liu / @poeminlash

08/10/2022 at 05:33AM

26
#>56 - Qing Liu / @poeminlash

08/10/2022 at 05:32AM

27
#>64 - Qing Liu / @poeminlash

08/10/2022 at 05:32AM

28
#>66 - Qing Liu / @poeminlash

08/10/2022 at 05:31AM

29
#>68 - Qing Liu / @poeminlash

08/10/2022 at 05:31AM

30
#>72 - Qing Liu / @poeminlash

08/10/2022 at 05:31AM

31
#>74 - Qing Liu / @poeminlash

08/10/2022 at 05:30AM

32
#>78 - Qing Liu / @poeminlash

08/10/2022 at 05:30AM

33
#>85 - Qing Liu / @poeminlash

08/10/2022 at 05:29AM

34
#>91 - Qing Liu / @poeminlash

08/10/2022 at 05:27AM

35
#>94 - Qing Liu / @poeminlash

08/10/2022 at 05:27AM

36
#>95 - Qing Liu / @poeminlash

08/10/2022 at 05:26AM

37
#>97 - Qing Liu / @poeminlash

08/10/2022 at 05:26AM

38
#>100 - Qing Liu / @poeminlash

08/10/2022 at 05:25AM

39
#>102 - Qing Liu / @poeminlash

08/10/2022 at 05:23AM

41
#>107 - Qing Liu / @poeminlash

08/10/2022 at 05:24AM