The simplest way to change visudo editor from nano to vi

If you are using ubuntu or debian, the answer is

sudo apt purge nano

It is not a joke, it works! Reference

Surely there is a regular way

sudo update-alternatives --config editor

which is also good. But I love the former way, as it also removes the nano editor, which I nearly never use.

how to do sudo without asking a password

sudo visudo, then add a line at the end of the editor

your-user-name ALL=(ALL:ALL) NOPASSWD:ALL

save and exit, done!