Debian – How to change the default text editor in the Debian (squeeze) distro

debianeditorsenvironment-variables

"Joe's own editor" does not come naturally to me. How do I change to using nano or vim?

I've tried

export EDITOR=nano

but it doesn't seem to be respected. I'd like visudo to respect this as well.

Best Answer

To change the default editor at the system level:

sudo update-alternatives --config editor

and then follow the onscreen prompts.

Related Question