title: Vim: Replacing a line with another one yanked before
body: <p>At least once per day i have the following situation:</p>
  <pre><code>A: This line should also replace line X
  ...
  X: This is line should be replaced
  </code></pre>
  <p>I believe that I don't perform that task efficiently.</p>
  <p>What I do:</p>
  <ul>
  <li>Go to line A: <code>AG</code> (replace <code>A</code> with the line number)</li>
  <li>Yank line A: <code>yy</code></li>
  <li>Go to line X: <code>XG</code> (replace <code>X</code> with the line number)</li>
  <li>Paste line A: <code>P</code></li>
  <li>Move to old line: <code>j</code></li>
  <li>Delete old line: <code>dd</code></li>
  </ul>
  <p>This has the additional disadvantage that line X is now in the default register, which is annoying if I find another line that should be replaced with A. Yanking to and pasting from an additional register (<code>&quot;ayy</code>, <code>&quot;aP</code>) makes this simple task even less efficient.</p>
  <p><em>My Questions:</em></p>
  <ul>
  <li>Did I miss a built-in Vim command to replace a line yanked before?</li>
  <li>If not, how can I bind my own command that leaves (or restores) the yanked line in the default register?</li>
  </ul>