May 212007
 

Sponsored Link

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

EDITOR=vi
export EDITOR
alias editor=$EDITOR

 Posted by at 7:10 am

  6 Responses to “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. I had the same problem I put ” export EDITOR= ” in .bashrc

  3. Thnks for the Solution…

  4. 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

  5. You need to export VISUAL to set the editor for user, not EDITOR.
    export VISUAL=vim works

  6. Excellent solution, thank you!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>