chris@politik.UUCP (Christopher Seiwald) (11/11/84)
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? Thanks. -- ---- Christopher Seiwald dual!ptsfa!politik!chris
david@ukma.UUCP (David Herron) (11/29/84)
I've noticed something similar when editing my sys file for readnews. Vi gives a complaint along the lines of "net: bad command". One of these days I'll track it down....
hansen@pegasus.UUCP (Tony L. Hansen) (12/02/84)
< I've noticed something similar when editing my sys file for readnews. < Vi gives a complaint along the lines of "net: bad command". One of < these days I'll track it down.... I believe that the pattern that vi/ex is looking for is ... [ve][ix]: ... meaning that any of vi:, ex:, ei: or vx: would signal the beginning of the command line. Since you exchange news with qusavx, you have a line in your sys file which begins with qusavx:net, hence the message about "net: bad command" from vi/ex. Tony Hansen pegasus!hansen
brianm@bigtuna.UUCP (Brian Martin) (12/05/84)
> 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
chris@umcp-cs.UUCP (Chris Torek) (12/08/84)
Re: setting EXINIT to contain a ``:source'' command: You can also create a file called ``.exrc'' in your home directory, which ex/vi/view/e/edit/[what's the other one?]---these are all the same program---will read every time it fires up. But I think the idea was to have *file dependent* behaviour. Some vi's will also read ./.exrc. -- (This line accidently left nonblank.) In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland
guy@rlgvax.UUCP (Guy Harris) (12/08/84)
> > 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. It's not documented anywhere, for which the author apologized a while ago. > Basically, what you want to do is to automatically initialize your editing > environment whenever you invoke vi. The intent of this feature (those lines are called "mode lines") was to permit the initial ex/vi environment to be dependent on the file you're editing. A laudable goal, I guess (I use neither "vi", which has mode lines in the 3.7 release, nor "emacs", which I believe permits you to do this kind of initializing based on the file type, i.e. on the last component of the file name, like ".c", ".s", etc., and my favorite editor has no modes to be set) but it can trap the unwary. A long time ago, somebody posted changes to make this feature disabled by default and requiring you to set the "modelines" flag to enable it; it sounds like this is the right way to go and it's what we've done on our systems. Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy
mark@elsie.UUCP (Mark J. Miller) (12/10/84)
I just write my own version of vi with the appropriate definitions for the type of directory I'm in. For example, the version of vi I use for typing letters is: #! /bin/sh EXINIT='set terse shell=/bin/csh sw=4 wm=4 aw map! #1 ^V |map! Ow >>$a|map #1 :n |map #3 :ta map ^[Oq Gi/\<^[A\>^["zdd@z map ^[Or 1G!Gvispell^M map ^[OM /Spellist^M map ^[Ol :.,$d^M' export EXINIT exec /usr/local/vi $@ This will start up just as fast as regular vi. -- Mark J. Miller NIH/NCI/DCE/LEC UUCP: decvax!harpo!seismo!elsie!mark Phone: (301) 496-5688
bsa@ncoast.UUCP (Brandon Allbery) (12/12/84)
I'm having a problem with .exrc and EXINIT on a Plexus P/35. I generally use a standard set of :set's to make C programming easier, and on ncoast!'s vi, they work well. But on the plexus, which has the same version (v2.13) of vi, any attempt to place a :set in .exrc or $EXINIT will produce a _N_o_ _t_e_x_t_ _i_n_ _b_u_f_f_e_r message. Does anyone know why this might be? Does the Microsoft-hacked ex/vi have a smarter $EXINIT handler? Or am I doing something wrong? ------------- ./.exrc ------------- set autoindent shiftwidth=4 showmatch autowrite --bsa (Just had a thought: MS ex/vi takes that. Maybe (from net examples) the plexus needs a colon in front? But I put one there in $RNINIT...) -- Brandon Allbery @ decvax!cwruecmp!ncoast!bsa (..ncoast!tdi1!bsa business) 6504 Chestnut Road, Independence, Ohio 44131 (216) 524-1416 <<<<<< An equal opportunity employer: I both create and destroy bugs :-) >>>>>>