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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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"
In recent versions of Ubuntu you use the alternatives system to manage the default, editor, e.g.:
update-alternatives --set editor /usr/bin/vim.basic
To see which editors are available for use:
update-alternatives --list editor
Some UNIX distributions might provide a
And it will ask you which editor to use.
Make sure you actually have
vim installed before trying to set it as your default editor.