[This article shows
, but the same thing will work for other
editors that read a setup file when they start up. -JP]
Like many people, I want different
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
startup files... one
mode I'd like to use.
that let me select the
file I want.
And I have
aliased so that, when I start it up, it tells me
file is in use.
Here are the lines (with comments) from my
file (the CD-ROM has a set for Bourne-type shells):
setenv EXSTAT text # INITIALIZATION FOR 'vi' ALIAS
# -- THESE ALIASES RESET THE .exrc FILE -- #
# SET 'vi' FOR 4-CHARACTER TABS/SHIFTS:
alias 4vi 'cp ~/lib/vi/exrc4 ~/.exrc; setenv EXSTAT programming'
# SET 'vi' FOR 8-CHARACTER TABS/SHIFTS:
alias 8vi 'cp ~/lib/vi/exrc8 ~/.exrc; setenv EXSTAT text'
# SET 'vi' FOR QUICK WORK WHEN SYSTEM IS SLOW (NO .exrc FILE):
alias qvi 'rm ~/.exrc; setenv EXSTAT quick'
# -- THESE ARE THE vi ALIASES. ONE SETS THE vi MODE FIRST -- #
alias vi 'echo "MODE: $EXSTAT"; sleep 1; /usr/ucb/vi \!*'
# CALL vi WITH A SEARCH:
alias vs '8vi; vi +/\!*'
variable remembers which setup file has been stored in
file. Also, because
you can't start
with a search (
option has been set... so, I start the
alias with an
Here's an example. I'll edit the file
and search for a line
that has the word
vs misteak report
"report" 45 lines, 2734 characters