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.

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):

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.