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
Debian: Debian Admin Step By Step Tutorials and articles with screenshots