Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site tektronix.UUCP Path: utzoo!watmath!clyde!akgua!sdcsvax!bmcg!cepu!trwrba!trwrb!sdcrdcf!hplabs!tektronix!jerryp From: jerryp@tektronix.UUCP Newsgroups: net.unix-wizards Subject: Re: reading of local .exrc files Message-ID: <2470@tektronix.UUCP> Date: Thu, 10-May-84 01:39:12 EDT Article-I.D.: tektroni.2470 Posted: Thu May 10 01:39:12 1984 Date-Received: Tue, 8-May-84 00:05:03 EDT References: <419@opus.UUCP> Organization: Tektronix, Beaverton OR Lines: 47 Like many people, I want different vi options set for writing a program than for working on a text file. Here's how I do it: Instead of putting mode lines within each file, or writing extensions to the filenames, I've got several different .exrc files... one for each vi mode I'd like to use. I have aliases that let me select the .exrc file I want. And, I have vi aliased so that, when I start it up, it tells me which .exrc file is in use. Here are the lines (with comments) from my .cshrc file: ----------------------------------- setenv EXSTAT "text" # initialization for 'vi' alias #---- THESE ALIASES RESET THE .exrc FILE ----# # SET 'vi' FOR 4-CHARACTER TABS/SHIFTS (RING BELL AS REMINDER): alias 4vi 'cp ~/.exrc4 ~/.exrc; setenv EXSTAT "programming^G"' # SET 'vi' FOR 8-CHARACTER TABS/SHIFTS: alias 8vi 'cp ~/.exrc8 ~/.exrc; setenv EXSTAT "text"' # SET 'vi' FOR QUICK WORK ON BUSY SYSTEM (NO .exrc FILE): alias qvi 'rm ~/.exrc; setenv EXSTAT "quick"' #---- THESE ARE THE vi ALIASES. ONE SETS THE vi MODE FIRST ----# # show whether using ~/.exrc4 or ~/.exrc8: alias vi 'echo "MODE: "$EXSTAT; /usr/ucb/vi \!*' # call 'vi' with a search # (must use 8vi because search requires a 'wrapscan', and .exrc8 has ws set) alias vs '8vi; vi +/\!*' ----------------------------------- The $EXSTAT variable remembers which .exrc? file (.exrc4, .exrc8) has been copied into the .exrc file. Also, as was mentioned in another unix-wizards article, you can't start "vi" with a search (vi +/PATTERN) unless the wrapscan option has been set... so, I start the "vs" alias with an "8vi". (Please direct all flames about BSD and C-shell to /dev/null.) --Jerry Peek, Tektronix, Inc. US Mail: MS 76-036, P.O. Box 500, Beaverton, OR 97077 uucp: {allegra,decvax,hplabs,ihnp4,mit-eddie,ucbvax}!tektronix!jerryp CSnet: jerryp@tek ARPAnet: jerryp.tek@csnet-relay Phone: 503/627-1603