44
rated 0 times
[
44]
[
0]
/ answers: 1 / hits: 33131
/ 3 Years ago, sat, september 25, 2021, 10:00:28
I'm trying to use sudoedit
, but it keeps running the nano
editor. My preferred editor is vim
. How can I make it the default?
Looking at the man page, man sudoedit
, I've noticed the following:
EDITOR Default editor to use in -e (sudoedit) mode if neither SUDO_EDITOR nor VISUAL is set.
SUDO_EDITOR Default editor to use in -e (sudoedit) mode.
VISUAL Default editor to use in -e (sudoedit) mode if SUDO_EDITOR is not set.
So I've set them all to /usr/bin/vim
, but sudoedit /etc/hosts
still uses nano
. Am I missing something?
$ EDITOR=/usr/bin/vim
$ VISUAL=/usr/bin/vim
$ SUDO_EDITOR=/usr/bin/vim
$ echo $VISUAL
/usr/bin/vim
$ echo $EDITOR
/usr/bin/vim
$ echo $SUDO_EDITOR
/usr/bin/vim
$ sudoedit /etc/hosts # This is still using nano
More From » text-editor