title: Working with vi buffers
body: <p>So I am learning about vim/vi/ex and I thought I had a pretty good understanding of the buffer system. (theres a gen purpose buffer and you can also name buffers). I know that anytime you use yank, change or delete, the contents of the general purpose buffer are over written. </p>
  
  <p>However, I was given a task to use a vi/ex command to delete the last 2 lines of the buffer and I am stumped. I can't seem to find the answer by searching the forums or the Internet in general so I thought I would ask the gurus of the interwebs for some help here. </p>
  
  <p>Is there a way to directly modify the contents of a buffer, or is the answer simply to paste the buffer, delete the last 2 lines and then yank it again? </p>
  
  <p>Any help is appreciated.</p>
  
  <p>EDIT: I would like to edit this question to include the question:what is the difference between a buffer and a register?</p>
  
  <p>I originally thought they were essentially the same thing, but have since learned otherwise. </p>
  
  <p>My new understanding is that the things I were previously referring to as buffers are actually registers, which makes more sense according to my knowledge of computers. </p>
  
  <p>Now, I believe the buffer is just the current copy of the text that you are modifying. Or more specifically, the area of main memory in which you are manipulating data.
  (So the answer to my question would actually just be :$-1,$d)</p>
  
  <p>However, I have run into conflicting information on these forums that say the opposite, referring to "registers" as "Buffers".</p>
  
  <p>If someone could clear that up I would be really appreciative. </p>
  
  <p><strong>EDIT: vim help got me all the answers I needed, can't delete the post though. It should be noted that there are a lot of answers to questions both on this site and many others that are voted up highly, but refer to registers as buffers incorrectly.</strong> </p>