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.
Is your version of 'vi' actually a link to 'vim'? If so, you might want to use .vimrc instead. I don't think vim looks at .exrc files. (At least not on my Linux box.)
In all modern versions of vi, you have to first set the exrc option in your home directory's .exrc file before vi will read the .exrc file in the current directory:
set exrc
This mechanism prevents other people from placing, in your working directory, an .exrc file whose commands might jeopardize the security of your system.
I'm sure you've already found and fixed your problem by now, but... for others who may run into the problem (like I recently did), you may want to check to make sure you DON'T have EXINIT defined in your environment. If it is, this will override anything you have in your .exrc file.