title: Vim search for a pattern and if occurs delete to end of line
body: <p>I am trying to search a text file for a certain pattern.  If this pattern occurs then it means that the rest of the line is not needed and therefore can be deleted.</p>
  
  <p>I have tried using the following commands, but so far have been unsuccessful.</p>
  
  <pre><code>:%s/{pattern}/d$
  
  :g/{pattern}/d$
  </code></pre>
  
  <p>If anyone has any suggestions they would be greatly appreciated</p>