Change sudo editor to vim

In Debian based distributions, the default editor will be nano. To change:

sudo visudo -f /etc/sudoers.d/defaults
add these:
Defaults env_keep += "EDITOR"
Save and exit.

Change editor:
export EDITOR=vim
Run editor:
sudo visudo