Set emacs -nw as default editor

Create a script that starts emacs with -nw flag, e.g. /usr/local/bin/emacs-nw.

#!/bin/sh

emacs -nw "$@"

Install it with update-alternatives --install.

sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/emacs-nw 2

Configure editor to be your new script.

sudo update-alternatives --set editor /usr/local/bin/emacs-nw

Add the following to your ~/.bashrc file (or the config file for your shell if it is not Bash).

export EDITOR="emacs -nw"

This should set (and export) an env variable setting your default editor as Emacs in non-graphical mode.