I believe I can do something like
export EDITOR=vi, but I'm not sure what exactly to enter, and where.
How can I set "vi" as my default editor?
You should add it to your shell’s configuration file. For Bash, this is
~/.bash_profile. You should also set
$VISUAL, as some programs (correctly) use that instead of
EDITOR). Additionally, unless you know why, you should set it to
vim instead of
TL;DR, add the following to your shell configuration (probably
export VISUAL=vim export EDITOR="$VISUAL"
You could also set your default text editor by using the following command.
sudo update-alternatives --config editor
As mentioned by Pablo Bianchi in a comment, you can run
And it will ask you which editor to use. If you don't see vim as an option, run
apt install vim
And try again.
If bash is your shell, then insert it into
.bash_profile in your home directory; if zsh is your shell, then insert it into
.zprofile; for other shells see the according documentation.