home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume6 / help / part2 / help.dir / vi / commands / delete.HLP < prev    next >
Encoding:
Text File  |  1986-11-30  |  1.0 KB  |  34 lines

  1.  
  2.     The letter 'd' is the delete operator in vi.  Because it is
  3.     an operator, it has no effect by itself; but requires a 
  4.     motion command to tell it the scope of the deletion.  As
  5.     a special case, "dd" deletes the entire current line.
  6.  
  7.     So, what can we do with this delete operator?  Basically,
  8.     'd' followed by any command that would move the cursor deletes
  9.     text up to and including where the cursor would have gone for
  10.     that motion.
  11.  
  12.     For example:
  13.  
  14.       de    delete 'til end of word
  15.       d^    delete back to beginning of line
  16.       df:    delete until next occurence of a ':'    
  17.       dL    delete to bottom of screen
  18.       d/how    delete up to next occurrence of "how"
  19.  
  20.       d?^[a-q]*:
  21.         delete back to next line which matches "^[a-q]*:"
  22.  
  23.  
  24.     Deletions are saved in queue of 10 buffers, numbered 1 thru 10.
  25.     The most recent deletion is always in 1.  You can get back
  26.     your most recent deletion with 'p', and other deletions
  27.     with `"np' where " is itself, and n is the number of the buffer.
  28.  
  29.     Therefore, to reverse the order of 3 lines, you could use 
  30.     this sequence of four commands:
  31.  
  32.         ddddp"2p
  33.          
  34.