title: Programming in Vim: What specific mechanism do *you* use to 'copy-paste' variables?
body: <p><strong>NOTE</strong></p>
  
  <p>This was flagged as a potentially subjective question, but it is not subjective. It is requested to learn the various <em>specific</em> ways that people use Vim so that a person coming from a "mouse-and-keyboard" oriented text editor might learn more of the Vim way of editing.</p>
  
  <p>This is <strong><em>not</em></strong> a subjective question about <strong><em>personal preferences</em></strong> or which editor or editing style is best.</p>
  
  <p>This is a specific question about the <strong><em>mechanical steps</em></strong> one would take to obtain an outcome in the Vim editor, using alternative editors as a baseline for cross-reference.</p>
  
  <p><strong>PROBLEM</strong></p>
  
  <p>Suppose you have the following code in your Vim and you want to get from <em>before</em> to <em>after</em> where before looks like this:</p>
  
  <pre><code>// Before //
  
  $mynames    = Array();
  $mynames['alice'] = 'alpha';
  </code></pre>
  
  <p>... and after looks like this ...</p>
  
  <pre><code>// After //
  
  $mynames    = Array();
  $mynames['alice'] = 'alpha';
  $mynames['betty'] = 'bravo';
  $mynames['cindy'] = 'charlie';
  $mynames['deana'] = 'delta';
  </code></pre>
  
  <p><strong>HOW NON-VIM EDITORS WOULD DO IT</strong></p>
  
  <p>Using a non-vim editor, programmer A would simply copy the first line for alice, paste it multiple times into the editor and then re-edit the values so that <em>alice</em> and <em>alpha</em> are replaced with the appropriate values, editing one line at a time.</p>
  
  <p>Using a non-vim editor, programmer B would create a rectangular selection that spans four lines, and just start typing the common text <em>$mynames[''] = '';</em> and then go back and fill in the appropriate values, editing one line at a time.</p>
  
  <p><strong>HOW ABOUT VIM?</strong></p>
  
  <p>Given that Vim is a significantly different approach from "mouse-and-keyboard" style editors of the day, this is a request for insight on the specific steps one takes in editing with Vim. Obviously, it is possible to just type each line individually, but it is assumed that there is a time-saving way to do this in Vim in a way that compares to what programmer A and programmer B did above.</p>
  
  <p>1) How would a vim programmer go about doing this edit operation, using a time-saving method like those above?</p>
  
  <p>2) If someone were to search the Internet for more examples of specific 'step-by-step' comparisons of Vim editing sessions vs "mouse-and-keyboard" style editing, what would one search for?</p>