i am new to unix. I have created a .exrc file in my home folder. I just entered set nu and set ai in the .exrc to check. But whenever I'm opening vi editor, this doesn't work.
Further, I entered as superuser, by typing su and password, and now opened a new file in vi editor, now it is working.
Do we need to have superuser privilege to have this? Please help me on this.
Here's what I think is happening:
vi
is actually a link or alias to vim
, a modern version of vi
..vimrc
file, which vim
will read if present instead of .exrc
.vi
is not a link to vim
, and ignores .vimrc
and reads .exrc
.Check the output of
$ which vi
$ ls -l `which vi`
$ ls ~/.vimrc
The solution would be to use .vimrc
instead of .exrc
.