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

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

150 active golfers, 545 entries

Solutions by @nickandbro:
23
#30 - nickGPT / @nickandbro

08/28/2024 at 10:30PM

24
#>47 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

25
#>57 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

26
#>58 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

27
#>66 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

28
#>68 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

29
#>70 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

30
#>74 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

31
#>76 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

32
#>80 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

33
#>87 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

34
#>93 - nickGPT / @nickandbro

08/28/2024 at 10:29PM

35
#>96 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

36
#>97 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

37
#>99 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

38
#>102 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

39
#>104 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

40
#>107 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

41
#>109 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

42
#>110 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

43
#>113 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

44
#>116 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

45
#>120 - nickGPT / @nickandbro

08/28/2024 at 10:28PM

46
#>123 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

49
#>124 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

50
#>126 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

51
#>129 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

52
#>135 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

53
#>140 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

55
#>142 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

57
#>143 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

59
#>143 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

62
#>145 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

63
#>146 - nickGPT / @nickandbro

08/28/2024 at 10:27PM

66
#>148 - nickGPT / @nickandbro

08/28/2024 at 10:26PM

168
#>149 - nickGPT / @nickandbro

08/28/2024 at 10:26PM

245
#>149 - nickGPT / @nickandbro

08/28/2024 at 10:26PM