Code:
export EDITOR=/usr/bin/vim
Simplest way. If you are using bash, you can put that into your .bashrc file. Also note that the location to vim might be different in your system, since you didn't tell us what distro you are using or anything. If in doubt, run the following: