Currently ':set all' gives me settings including 'report=5'. I want to
change this to 'report=10' such that whenever I open the Vi editor &
edit next time, it should show me ''report=10'.
Also, I want the setting 'set noai' to be set always(I should not
change everytime). How do you do it?
Thanks!
Add the commands to $HOME/.exrc
Peppe
--
"Before you criticize someone, walk
Preben "Peppe" Guldberg __/-\__ a mile in his shoes. That way, if
c92...@student.dtu.dk (o o) he gets angry, he'll be a mile away
----------------------oOOo (_) oOOo-- - and barefoot." --Sarah Jackson
Or set them in the EXINIT environment variable in your .profile
EXINIT="set noai report=10" ; export EXINIT
> > Add the commands to $HOME/.exrc
> Or set them in the EXINIT environment variable in your .profile
> EXINIT="set noai report=10" ; export EXINIT
I keep forgetting to mention EXINIT.
Off the top of my head, I can only see limited use of it outside
scripts, unless you include a "set exrc" or "source $HOME/.exrc"
command. Besides for debugging purposes, that is.
Does anyone actually use EXINIT as their primary way of configuring
ex/vi.
I did for many years before switching to vim.
It has the advantage that it is one less file to haul around when you are
setting up a new system/account. That is, you're going to have to bring
over your .login and .cshrc anyway, so you might as well have your vi
config contained there instead of in (yet) another file.
X Thus wrote Al Sharka <ash...@my-deja.com>
X > Peppe wrote:
X
X > > Add the commands to $HOME/.exrc
X
X > Or set them in the EXINIT environment variable in your .profile
X > EXINIT="set noai report=10" ; export EXINIT
X
X I keep forgetting to mention EXINIT.
X
X Off the top of my head, I can only see limited use of it outside
X scripts, unless you include a "set exrc" or "source $HOME/.exrc"
X command. Besides for debugging purposes, that is.
X
X Does anyone actually use EXINIT as their primary way of configuring
X ex/vi.
X
X Peppe
I use it as a gateway to my .exrc file. I invoke my vi via a script and
what the script does is look in the current directory to see if there is
a directory local .exrc and if there is, I use the EXINIT to source the
directory local .exrc. Now generally, the directory local .exrc also
sourced $HOME/.exrc, but what it also did was override $HOME/.exrc
settings that I might like to have configured differently for the files
of this specific directory. Of course I had the script verify that I
owned the directory local .exrc file and that it was _NOT_ group nor
world writable.
There were 2 specific things that I tended to do. For source files, the
vi wrapmargin was turned off (I generally had it on as wm=4 for text
file editing). The other change was that I had inherited a set of
source files where the shiftwidth was 3 (I personally like 4), but when
in Rome...
So while 99% of the time, all that my EXINIT does is to source
$HOME/.exrc, my approach allowed, me to use a custom .exrc when I wanted
and I also had the flexibility to scan the file being edited via the
script for other characteristics that I might want to take into
consideration when editing the file.
Of course that that I use Vim most of the time, I could implement this
as part of the .vimrc using the Vim scripting language. But since I
have a tool that already works for me, I just tweaked it to look for
.vimrc instead of .exrc and continue to use my script to invoke Vim.
Bob Harris