Go into your ~/.bashrc and then add the environment variable export EDITOR=vim, then run source ~/.bashrc
export EDITOR=vim
source ~/.bashrc