home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10202 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  1.5 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!unido!pki-nbg!hitkw14!smr
  2. From: smr@hitkw14.pki-nbg.philips.de (S.Riehm)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: vi (cut and paste)
  5. Keywords: vi
  6. Message-ID: <smr.714294202@hitkw14>
  7. Date: 20 Aug 92 07:03:22 GMT
  8. References: <3815@keele.keele.ac.uk>
  9. Sender: news@pki-nbg.philips.de
  10. Lines: 40
  11.  
  12. phd85@seq1.keele.ac.uk (D.H. Holden) writes:
  13.  
  14.  
  15. > hi, 
  16. >    Does anyone know how you cut a range of text to one
  17. >   
  18. >    of the named buffers, where the range does not cover
  19. >   an integer number of lines, i.e., 
  20.  
  21. >  How do i cut from here > text  text text ..........
  22.  
  23. >  ............... n number of lines .....
  24.  
  25. > ...... to here <  into the named buffer "a for example?
  26.  
  27. as soon as you mention the word "lines" in vi you get complete lines
  28. only!
  29.  
  30. However, You can specify a search pattern, or any movement pattern, so
  31. you could move the cursor to the start position, then type;
  32. "ay/<  into/^M
  33.  
  34. using your examply above. This will yank everything up to but not
  35. including the string in the search pattern.
  36.  
  37. you could also do stupid things like:
  38. "ay120W
  39. which would yank the next 120 blank separated words.
  40.  
  41. This works for delete, change, >> << etc etc also.
  42.  
  43. good luck
  44.  
  45. -----------------------------------------------------------------
  46. Stephen Riehm        Configuration Management       _-_|\ 
  47. smr@pki-nbg.philips.de    Philips Kommunikations Industrie  /     \
  48. Work: +49 911 526 2975    Nuernberg, Germany          \_.-.*/
  49. Fax:  +49 911 526 2095    "I was there, now I am here!"           v 
  50. "My company speaks another language, I CAN'T speak on it's behalf"
  51.