home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / misc / 4593 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  928 b 

  1. Path: sparky!uunet!netxcom!jwc
  2. From: jwc@netxcom.netx.com (Jeff Comer)
  3. Newsgroups: comp.unix.misc
  4. Subject: Re: how to return to exactly the same editing spot in vi (not '')
  5. Message-ID: <1415@netxcom.netx.com>
  6. Date: 15 Dec 92 21:17:22 GMT
  7. Organization: The Chaos Bobs
  8. Lines: 18
  9.  
  10. tony2@prefect.cc.bellcore.com (gozdz,antoni s) writes:
  11. >A simple question about vi: when I want to return
  12. >quickly to the previous edited spot and use '',
  13. >the cursor returns to the beginning of the line;
  14. >is there a command (simple! like '') that would return
  15. >me to the exact spot (word, character) last edited on
  16. >that line?
  17.  
  18. Use the backquote (`) instead of forward quote. Edit something, move around 
  19. a little, and then try it. It works. A key sequence I often use is -
  20.  
  21.   ma     mark this spot to letter a
  22.   <do some stuff>
  23.   `a     puts me right back where I was.
  24.  
  25. Now if vi could just remember those marks after editing another file....
  26.  
  27. -JC
  28.