In ubuntu machines, whenever we want to run visudo /etc/suders file open in nano editor. Most of time Linux Administrators used vi or vim command to edit files, So I like to edit /etc/suders in vim or vi command.

So In this post, we will see how can we change visudo editor nano to vim

For this we just need to edit /etc/suders file. Add one line for editor that we want to edit this file. below image show that we have to add one line Defaults editor=/usr/bin/vim as shown in below image.

After adding this line in /etc/suders. save file and try to reopen file through visudo, /etc/suders will open in vim

visudo_editor_nano_vim