Is there virc or exrc for saving vi configuration settings in AIX?

There's no Vim in AIX (6 and 7), but Vi is natively available.

I want to save my configuration for Vi like `set nu` to number lines in files.

I couldn't find configuration related to Vi in /etc/ or /usr/etc/ folders.

Please help me with that.

I think it is ~/.exrc but it's in the man pages for vi. Sadly I don't have an AIX server available to check it though.

I hope that this helps,
Robin

Thank you, Robin, it helped, but it's user-specific, I'd like to find system-wide solution that would apply to all users.

I already tried creating, editing, and adding into `/etc/exrc` and `/etc/vi.exrc` as suggested in other forums but with no success.

No, you don't. You have no right to decide how other people on your system want to use vi . You should just use $HOME/.exrc to set the defaults you want when you use vi and ex (and view , rview , etc.) and not assume that you know how I want those utilities to behave when I log in to your system.

1 Like

I suppose if you want to have a standard, you could soft link $HOME/.exrc to a central file (e.g. /etc/exrc), making the central file read-only. To alter the settings, a user would need to:-

rm ~/.exrc
cat /etc/exrc > ~/.exrc

That would then copy, but cut them adrift from your standard settings and they could then change them as to their need.

Personally I think it's a terrible idea, but that is a way you could make it work.

Robin