There're several ways to solve this:
- For session-scope only:
- For single user:
- For all users:
$ set -o vi
$ vi ~/.profile
...
EDITOR=vi; export EDITOR
$ vi /etc/profile
...
EDITOR=vi; export EDITOR
$ set -o vi
$ vi ~/.profile
...
EDITOR=vi; export EDITOR
$ vi /etc/profile
...
EDITOR=vi; export EDITOR