home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10224 < prev    next >
Encoding:
Text File  |  1992-08-20  |  2.3 KB  |  68 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!iWarp.intel.com|ichips!intelhf!dawson
  3. From: dawson@intelhf.hf.intel.com (Bryan Dawson)
  4. Subject: Re: vi (cut and paste)
  5. Message-ID: <1992Aug20.174952.73@intelhf.hf.intel.com>
  6. Keywords: vi
  7. Organization: Development Tools Operation, Intel Corp., Hillsboro  OR
  8. References: <3815@keele.keele.ac.uk> <1992Aug17.200149.7817@s912%bnf.com> <515@alden.UUCP>
  9. Date: Thu, 20 Aug 92 17:49:52 GMT
  10. Lines: 56
  11.  
  12. sgr@alden.UUCP (Stan Ryckman) writes:
  13.  
  14. >In article <1992Aug17.200149.7817@s912%bnf.com> bibb@s912%bnf.com (Ken Bibb) writes:
  15. >>In <3815@keele.keele.ac.uk> phd85@seq1.keele.ac.uk (D.H. Holden) writes:
  16. >>In the following texT:
  17. >>aaabbbbbb
  18. >>bbbbbbbbb
  19. >>bbbbccccc
  20. >>
  21. >>I'll assume you want to cut the b's out and save them into buffer a.
  22. >>1) position the cursor at the beginning of the range to be cut (1Gfb will work
  23. >>   in this example).
  24. >>2) ma (mark the location with marker a)
  25. >>3) move to the end of the range (Gfc will work in this example)
  26. >>4) "ad`a will cut the range and put it into buffer a
  27.  
  28. >NOT!
  29.  
  30. WAY!
  31. Note the subtle distinction between the ' single quote and the ` back quote
  32. which is sometimes difficult to see...  VI uses the ` back quote to mean
  33. "treat the marks as character positions rather than line positions".
  34.  
  35. >This grabs all three full lines.  (I tried it!  Did you?)
  36.  
  37. I just did and he probably did also... certainly works fine for me.
  38.  
  39. >aaaccccc
  40.  
  41. >and the buffer to contain:
  42. >bbbbbb
  43. >bbbbbbbbb
  44. >bbbb
  45.  
  46. >"Mark" (the "m" command) only marks the line, NOT the cursor
  47. >position within the line.
  48.  
  49. As noted above, mark DOES mark the "cursor" (character) position but 
  50. the 'standard' access to marks using the ' single quote accesses entire
  51. lines.  Use the ` back quote to access character positions...
  52.  
  53. >for sure whether there _is_ a way to do this, and if I'm wrong I'd
  54. >like to know.  But please, _TRY_ it before posting!
  55.  
  56. >Stan.
  57. >--
  58. >This .signature has expired.  Call 1-900-YOU-FOOL to find out why.
  59. >    Stan Ryckman   sgr@alden.UUCP
  60.  
  61. _________Thanks and Regards from: _____________________________
  62.  
  63. >>  Bryan_Dawson_at_jfccm1@ccm.hf.intel.com      (me @ work)
  64. >>  (503) 696-4231   >> dawson@pdaxs.techbook.com  (me @ play)
  65. At the bank he was shocked to see such a den of equity.
  66. _______________________________________________________________
  67.  
  68.