Replacing nano-default-editor doesn't affect visudo

Jonathan Wakely via devel <[email protected]>
Newsgroups gmane.linux.redhat.fedora.devel
Message-ID <CACb0b4nO2atSN9-4UqbRvToZdan8XiAkNfEiTnYEKBH6SpcCmA@mail.gmail.com>
I recently installed a new Fedora system and was recreating all my
preferred settings and realized that:

1) The https://fedoraproject.org/wiki/Changes/UseNanoByDefault change
for F33 never did the suggested documentation change, i.e. the Fedora
quick docs do not say how to replace nano by installing
vim-default-editor. That would be helpful.

2) Installing vim-default-editor doesn't help with 'sudo visudo' as
that command will still use nano to edit the sudoers file. That's
because the sudo command isn't in a login shell and so will not have
EDITOR set in the environment. This means that visudo doesn't care
about the environment, it only cares about the sudoers 'editor'
setting.

To get visudo to use vim, you need to either completely uninstall
nano, or use 'sudo --login visudo', or add this to the sudoers config:

Defaults editor /usr/bin/vim

Is there a better way to "fix" visudo to use vim, without having to
manually edit config files or use sudo --login every time? If not,
should we add one? Should the nano-default-editor and
vim-default-editor packages install an extra file under /etc/sudoers.d
to set the editor?

I fully support using nano as the system-wide default, but it should
be easy to switch back to vim for the people who want that.

-- 
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: https://forge.fedoraproject.org/infra/tickets/issues/new
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.