I executed these two commands:
export VISUAL=/usr/bin/vim
export EDITOR=/usr/bin/vim
And I checked if they were correctly updated by env
. But I get a strange editor when I run sudo visudo
.
Though I do not know the editor, at the bottom of the console it says this:
-----Mg: sudoers.tmp (fundamental)----Top------------------
(Read 29 lines)
This editor is useless because I cannot move the cursor. What I can do is to close the console.
What makes this weird editor run? What command should I execute to change editors?
From
:man visudo
(second paragraph):So, to configure another editor, you need to change the
/etc/sudoers
configuration and add for example aDefaults editor /usr/bin/vim
line.The strange this is that Vim should be the default editor already?! Based on your output, that may be from Vim (with corrupted terminal), or another editor (you could check the process tree).