export EDITOR=gedit && sudo visudo
visudo, which does not behave like nano any more. I’m not a
vi fan, please accept my apologies, Ive said it. I’m a
nano fan :)
But I understand some users feel more comfortable with
gedit or other GUI text editors.
The way to go now is:
export EDITOR=gedit && sudo -E visudo
where the -E option preserves the user environment variables.