home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15316 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.4 KB

  1. Path: sparky!uunet!haven.umd.edu!mimsy!nocusuhs!nmrdc1!cbda8.apgea.army.mil.!mlwilkin
  2. From: mlwilkin@apgea.army.mil (Michael L. Wilkins <mlwilkin>)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: .exrc file for vi customization
  5. Message-ID: <1993Jan8.145501.29122@apgea.army.mil>
  6. Date: 8 Jan 93 14:55:01 GMT
  7. References: <smr.723822561@hitkw14> <1992Dec09.171536.9561@ssc.com> <1992Dec11.231726.11125@black.ox.ac.uk>
  8. Sender: mlwilkin@cbda
  9. Organization: APG-Edgewood
  10. Lines: 37
  11. Nntp-Posting-Host: cbda7.apgea.army.mil
  12.  
  13. In article <1992Dec11.231726.11125@black.ox.ac.uk> tbrann@black.ox.ac.uk (Tony Brannigan) writes:
  14. >fyl@ssc.com (Phil Hughes) writes:
  15. >|>I have one thing to add.  Much like Stephen's example I find that I need
  16. >|>different vi setups based on what I am working on.  To automate this
  17. >|>process I put the like
  18. >|>    so .viset
  19. >|>in my .exrc file.  Whenever vi is started it looks for the file .viset in
  20. >|>the current directory.  If found, it reads it in much the same as it reads
  21. >|>.exrc.  If it doesn't find it an error message that that effect quickly
  22. >|>blinks on the status line and things continue.
  23. >|>
  24. >|>This makes it possible to have special vi setups for various directories.
  25. >|>Thus, when I am working on documentation I put a .viset in the
  26. >|>documentation directory that binds function keys to troff font changes and
  27. >|>sets a wrap margin.
  28. >
  29. >In any implementation of vi I have used, it checks the current directory
  30. >for a file called ".exrc".  It first checks your home directory for a
  31. >.exrc, and if it finds it sources it, then checks the current directory
  32. >for a .exrc and, if it finds it, sources it.
  33. >
  34. >This assumes you have not set the EXINIT environment variable.
  35. >
  36. >Tony
  37. >-- 
  38. >"And soon all of us will sleep under the earth, | tbrann@ox.ac.uk
  39. >  we who never let each other sleep above it."  | u90afb@ecs.ox.ac.uk
  40. >   Marina Tsvetayeva 1915                       | oupafb@ox.ac.uk
  41.  
  42. I agree. When I started using vi many years ago, I only had a .exrc file
  43. for initialization and everything evolved nicely. I once asked an ISA type
  44. for a easy reformat command. He wrote a key map using EXINIT. This was
  45. great until I discovered that I had lost all my neat customizations when I
  46. worked in a directory other than $HOME. So, I started creating .exrc files
  47. all over the place until I found out that I could accomplish the same key
  48. mappings in my $HOME/.exrc, I could eliminate the problem with EXINIT and
  49. stopped worrying about version controlled on all those .exrc files.
  50.