Change

export EDITOR=usr/bin/vim

The default editor for ‘visudo’ was set to usr/bin/nano, and I wanted to use the vim editor, so executing this command changed that. Initially I tried someone’s example of export EDITOR=vim and that didn’t work, you have to declare the full path for the editor