title: How to paste the results of a :g/foo/p search at the end of the file ?
body: <p>1) I search foo in a file with the global command :g :</p>
  
  <pre><code>:g/foo/p
  </code></pre>
  
  <p>and I want to paste the results at the end of the file. How must I proceed ?</p>
  
  <p>2) Same question (or is it ?) with the results of an echo statement :</p>
  
  <pre><code>:echo IndexByWord(['word1', 'word2', 'word3', etc])
  </code></pre>
  
  <p>(about this function, see : <a href="https://stackoverflow.com/questions/5869997/vim-how-to-index-a-plain-text-file">Vim : how to index a plain text file?</a>)</p>
  
  <p>Thanks in advance</p>