Howto Change Default editor in Debian Etch

By Default Debian Etch Provides the nano editor you need to follow this procedure.In this example i want to use vi editor as my default editor

Administrators who wish to change the default editor for all users will have to update the alternatives system using:

# update-alternatives --config editor

Once you enter it opens available editor options from your server you should see similar to the following screen here i have selected option4 for vi editor

If you are an user wishing to change the default editor can define the environment variable EDITOR by introducing the following lines in their own profiles

export EDITOR
alias editor=$EDITOR

6 thoughts on “Howto Change Default editor in Debian Etch

  1. The profile advice does not appear to work in either Etch or Ubuntu; I have .bash_profile containing the EDITOR=vim.tiny;export and alias lines as above, I even created a ~/bin/editor symlink! But I still get nano 🙁

  2. Thank you for your help, but I think that I make the same mistak than other people in comment. Changing EDITOR will not solve 100% the problem. Debian based solution (debian, ubuntu, …) use the “alternatives” to create base aliases. If you update the EDITOR, this will update the value for something called the “editor”. If you try to type :­­>vi myfile.txt and it’s not the VIM Editor… it because you don’t update the vi alias also. You need to do that also:

    update-alternatives –config vi

    Every “alternatives” aliases are located in /etc/alternatives. update-alternatives –config editor will solve the problem if you was typing :>editor myfile.txt

    Then you need to these commands for full vi support:
    update-alternatives –config editor
    update-alternatives –config vi
    update-alternatives –config view

Leave a comment

Your email address will not be published. Required fields are marked *