Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!husc6!bloom-beacon!gatech!pyr!tad From: tad@pyr.gatech.EDU (Tad K. Mannes) Newsgroups: comp.unix.questions Subject: Re: Mail and vi Message-ID: <3816@pyr.gatech.EDU> Date: Thu, 16-Jul-87 12:32:22 EDT Article-I.D.: pyr.3816 Posted: Thu Jul 16 12:32:22 1987 Date-Received: Fri, 24-Jul-87 04:35:59 EDT References: <467@potpourri.UUCP> <581@sol.ARPA> Reply-To: tad@pyr.UUCP (Tad K. Mannes) Distribution: na Organization: Office of Computing Services, Georgia Tech Lines: 41 Summary: VISUAL env. var. and writting shell script In article <581@sol.ARPA> ken@rochester.UUCP (Ken Yap) writes: >While on this topic, Mail on my system (4.3 BSD) doesn't use $PATH for >looking for vi, when ~v is used. Anybody else have the same problem? >It appears to have been fixed by SunOS 3.2. Not that it matters much >to me, I mostly use MH. > > Ken Getting mail to use vi when you type "~v": This really depends on the mail program you use, so you should look it up in the online manual. More than likely though, you will need to set an environment variable (namely VISUAL) to the vi program including the path (e.g. VISUAL=/usr/ucb/vi ). And be sure to export it (that depends on the shell you use). Or you might try putting the "VISUAL=/usr/ucb/vi" in a file by the name of ".mailrc". and then you don't have to worry about having it exported from your shell, because the .mailrc file is automatically executed when mail is started up (this too might depend on the mail program). Getting mail to go directly into vi when sending a message: So far as I know there is no way to get mail to do that, however you can write an alias or function which will put you in "vi" and then pipe that file into the mail program. You might try something like the following: alias sendmail "vi .letter; mail $* < .letter" This depends on the shell you use but I think this will work on the c shell (csh). I can't remember is the "$*" is correct though, if it is'nt you might try "$@" instead. And to use this new command you would do something like this: sendmail tad and then you would be put in vi to edit your letter. Once you leave the editor the letter file would be piped into mail and sent to the user "tad" (thats me :-) -- tad@pyr.gatech.edu | Tad K. Mannes CCOPRTM @ GITVM1 | Office of Computing Services | Georgia Institute of Technology