Ubuntu Use Vi As Default Editor

Edit .bashrc for root or .profile for other users and insert the line below.

export EDITOR=vi

Note: Alternative way to do this is to set it globally as an environment variable.