Hi, The simplest solution is to set EDITOR to vi in your whole environment, not only for login shells. In my environment, I set EDITOR to vi in my own ~/.bashrc.d/vi file.
If, for any reason, you cannot set it (for instance, if you want to use vi only for sudo but what to use nano for the rest of the things), you can set the SUDO_EDITOR variable (this is supposed to work but I never tried it). HTH, Alejandro On Fri, Aug 28, 2026 at 7:06 PM Jonathan Wakely via devel < [email protected]> wrote: > 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 > -- Alejandro
-- _______________________________________________ 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
