URGENT : vi doesn't read my .exrc


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting URGENT : vi doesn't read my .exrc
# 1  
Old 08-06-2009
URGENT : vi doesn't read my .exrc

I have created some custom commands (using the map macro feature) and have those map commands in my $HOME/.exrc file (I am using bash) Here are the commands, which I have in my $HOME/.exrc

map! F /user\.base\.scope^V^Mk4ddF
map! L /user\.base\.search^V^Mk4ddL
map! V /addAllPrivs^V^Mjlcwfalse^V^[V
map! T /addAllPrivs^V^Mk4yy3jpj3e4l3x^V^[T

However for some reason when I launch vi using command like vi /tmp/1.txt and then check the vi session, none of these custom commands are available. I believe somehow it's not reading the $HOME/.exrc file. I tried to copy the same file to $HOME/.vimrc as well. The permissions look OK. Also tried to set EXINIT variable with these commands on one line delimited by "|" but no luck.

I also tried to force vi to read the file by using command like vi -u $HOME/.exrc /tmp/1.txt but still no luck

This is kind of urgent for a production change I have to do in the next hour. Any help will be really appreciated.
# 2  
Old 08-07-2009
Several things you might want to check:

1. make sure VIMINIT is not set if you intend to use EXINIT.
VIMINIT takes precedence over EXINIT.

2. After you invoke vi, try the following ex command (type ":" first):

Code:
so $HOME/.exrc

This is not meant to be a permanent fix, but at least it will tell you if .exrc can be sourced and if it works.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read in script doesn't work

I am trying to run a script to make a simple modification to a number of similar files. The sed works, but after it runs and the differences are displayed, the script does not read ans to start a renaming script if the user answered Y or y.for i in "$@" do sed -f myfile.sed $i >$i.new diff... (2 Replies)
Discussion started by: wbport
2 Replies

2. Shell Programming and Scripting

awk doesn't understand 'read' statement!!!

While working on awk programming, i found that it doesn't understand 'read' statement. Then what's the use of 'continue' and 'break' statement in awk. For ex: awk '{k=1; while (k<10) {print $0; k++}}' emp.lst Now, please say if I want to put the logic that after priting 1 line, it will ask for... (13 Replies)
Discussion started by: ravisingh
13 Replies

3. Solaris

Dual Booting - Solaris image CD doesn't read in BIOS

I am trying to install solaris 10-x86 as second OS on top of Windows XP. I have downloaded iso image from Oracle website and burned into bootable cd. when I loaded into CD-drive and made changes in BIOS to boot from CD. Its not reading from CD drive. After restarting the system with CD(solaris... (8 Replies)
Discussion started by: SunSolars_admin
8 Replies

4. Solaris

Why X-server doesn't read /usr/openwin/lib/locale/C/OWfontpath???

Hi all! Solaris 10. Why did X-server stop to read OWfontpath? Any suggestions. Thanks. (0 Replies)
Discussion started by: wolfgang
0 Replies

5. UNIX for Dummies Questions & Answers

.exrc is not working

Hi I want to customise my vi environment.So i have created a a .exrc file in my working directory and written all set commands.But when i am invoking vi ,it is not taking any effect of the vi. Can anybody have any idea what is happening Thanks in advance Regds Sas (12 Replies)
Discussion started by: SasDutta
12 Replies

6. Shell Programming and Scripting

sftp -b doesn't read the batchfile

Several of our end-users need to send a file to our insurance carrier using ssh and sftp. We've put together a Windows VBS script that opens the ssh tunnel and calls sftp with the -b option pointing to a batch script in the same directory, however sftp doesn't seems to be reading from the... (1 Reply)
Discussion started by: kmw
1 Replies

7. Shell Programming and Scripting

script doesn´t read last line

hi, i have a file with 5 lines, like this: 068|3|20080331|P|21090|5|0|0|0|0|0|0|0 068|3|20080331|P| |6|0|0|0|0|0|0|0 068|3|20080331|P|21040|7|0|233|105|161|6157|6656|101 068|3|20080331|P| |T|188842|33996|14543|3226|7193|247800|298 068|3|20080331|T|... (2 Replies)
Discussion started by: DebianJ
2 Replies

8. Shell Programming and Scripting

urgent -read exit status

i have written a shell script that invokes main class of a java prg. the java prg does a System.exit(0) or (1) based on condition. how can i read or check the status in unix.... (4 Replies)
Discussion started by: iamcool
4 Replies

9. Shell Programming and Scripting

while read loop w/ a nested if statement - doesn't treat each entry individually

Hi - Trying to take a list of ldap suffixes in a file, run an ldapsearch command on them, then run a grep command to see if it's a match, if not, then flag that and send an email alert. The list file (ldaplist) would look like - *********** o=company a o=company b *********** **... (7 Replies)
Discussion started by: littlefrog
7 Replies

10. Shell Programming and Scripting

Urgent!!!Read directory from a file

I have a receive script file which had lots of direcorties to process,but now,I don't want to hardcode them,I need input the directory name in a Property.txt file,then write shell code to read the directory name from Property.txt to the script file so I can get flexible on it.But when I ran the sh... (3 Replies)
Discussion started by: joshuaduan
3 Replies
Login or Register to Ask a Question