Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site bigtuna.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!noscvax!uhpgvax!islenet!bigtuna!brianm From: brianm@bigtuna.UUCP (Brian Martin) Newsgroups: net.unix,net.text Subject: Re: can vi/ex source beginning of text on startup? Message-ID: <107@bigtuna.UUCP> Date: Tue, 4-Dec-84 17:20:22 EST Article-I.D.: bigtuna.107 Posted: Tue Dec 4 17:20:22 1984 Date-Received: Sat, 8-Dec-84 04:46:43 EST References: <31@politik.UUCP> Organization: U. of Hawaii, Bekesy Lab, Neurophys. Lines: 51 Xref: watmath net.unix:3036 net.text:288 > I recall seeing a text file with ex commands at the beginning, e.g. > > (some characters):set wrapmargin=10 > > It seemed like ex was meant to source the lines when starting up. > Does this work and is it documented? Sure, it works, but I don't know where it's documented. Basically, what you want to do is to automatically initialize your editing environment whenever you invoke vi. There are two ways to do it. You can either 1) put the initializing commands in a file called ".exrc" in your HOME directory, or 2) put the initializing commands in a file, and place a ":source" command with a pointer to that file in the "EXINIT" environment variable. I use the second approach (with "sh"), e.g., EXINIT=":source $HOME/.exinit"; export EXINIT My $HOME/.exinit file contains the following text (^[ is ESC, ^V CNTL-V, etc.): set magic autoindent shell=/bin/sh wrapmargin=1 w1200=12 map #1 :w!^V^MGo^V^[:$!mspell^V %^V^M map #2 0i/\<^V^[A\>^V^["zdd@z map #3 :/^Possible^V misspellings:$/+1,$!dict.addto^V^M abbr qmc Queen's Medical Center abbr jabsom John A. Burns School of Medicine abbr dc discontinue abbr ddx differential diagnosis abbr dx diagnosis abbr hx history abbr meds medications abbr pe physical exam abbr perrla pupils are equal, round, and reactive to light and accomodation abbr pta prior to admission abbr ro rule out abbr rx treatment abbr ss symptoms/signs abbr sx symptoms abbr tx therapy Funny thing--whoever compiled vi for our machine severely resctricted the number of macros and abbreviations that I can define. What you see defined above is the maximum that can be defined on our machine (a Dual running System V). Nevertheless, I find the abbreviations and function key mappings very useful. Brian Martin UUCP: ..!{dual,ihnp4,vortex}!islenet!bigtuna!brianm