As a new vim user, I'm still trying to figure out what to do with them.
What do you find yourself macroing, generally?
What do you find yourself macroing, generally?
$address = array(
'name' => '',
'line1' => '',
'line2' => '',
'state' => '',
'country' => '',
'postcode' => '',
);
That's a lot of commas and quotes etc. Nowadays I usually punch this into vim: name
line1
line2
state
country
postcode
Then I start on the first line and record a macro that wraps that word in quotes, then appends hashrocket, quotes, comma, and then moves to the next line. Run the macro 5 times with 5@<register> and the you get your array.