My default editor is pico at my server. I use Bash and Linux.
I tried to change Vim to be my default editor unsuccessfully by
echo vim > $EDITOR
if you want vi to be your default history editor (which is why I'm here)
edit ~/.bashrc and add
set -o vi
anywhere in the file. Then all the lovely vi command history is available (esc k etc).
Sorry if this is slightly off topic, but my search landed me here....
I don't have an EDITOR
environmental variable. Perhaps you could specify your distribution? My bashrc
does define this:
alias vi='vim'
and supposedly if vim can't find a file called .vimrc
in your home directory it runs in "compatibility mode" and you only get vi features until you say type :nocp
If it is based on your EDITOR
environmental variable you would set it like this in BASH:
export EDITOR='vim'
I needed to install Vim manually in a virtual environment. The only command that worked for me was:
`sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100
Source