It is currently Tue, 17 May 2022 02:20:01 GMT

Author Message
 vi set commands using kornshell
Does anyone now how I can set vi to run the following commands in a
kornshell enviroment

set EXINIT 'set shiftwidth=4  tabstop=3 showmatch ignorecase\
map M mx\
map q "xp\
map Q "xP\
map C "xd'"'"'x'

I want to be able to log on and have the above commands intiallized in

My .exrc file has the following description:

" DESCRIPTION:  When you invoke the vi editor, it looks for the $EXINIT
"               environment variable, and if found, uses it as a command
"               (or list of commands separated by | characters) to
"               run.  If $EXINIT is undefined, vi checks for startup
"               in this file (~/.exrc).

I tried to put the above commands in .exrc and .kshrc files but vi still
uses the defaults values.

If I run in c shell mode the above commands will work in vi.

Thanks in advance for your help.

 Sun, 01 Feb 2004 02:43:06 GMT   
 vi set commands using kornshell

1) EXINIT= instead of set EXINIT
2) put a space before \
3) the string should be surrounded by " not by '
4) you have to mask the " in the last line (\")
5) you have to export the EXINIT variable

So, the statement looks like this (not checked in vi):
EXINIT="set shiftwidth=4  tabstop=3 showmatch ignorecase
map M mx
map q \"xp
map Q \"xP
map C \"xd'\"'\"'x'"
export EXINIT

Check the content of EXINIT by starting a new shell and
echo it's value:
echo $EXINIT

In the .exrc-file in your home directory you must write the set and
map commands.

Xpost and Followup to comp.editors, where vi questions are ontopic.

Greetings from Switzerland -- Gruesse aus der Schweiz

 Sun, 01 Feb 2004 15:43:07 GMT   
   [ 2 post ] 

Similar Threads

1. Q: Problem using ksh set command to set positional parameter

2. set -o vi will not work when putting command in .bashrc file

3. setting command line editor to vi...

4. setting vi to always start as command line editor

5. setting command line vi

6. Using vi as command line editor

7. lost command recall after using vi

8. bash command line editing using vi

9. Vi using a command file?

10. using macros with vi keys on command line?

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software