Closed aartoni closed 1 year ago
sudo EDITOR=nvim visudo
is fine. Or, soft link nvim to /usr/bin/vi
.
@majamin linking nvim to /usr/bin/vi
looks kinda janky, running sudo EDITOR=nvim visudo
would be fine if visudo didn't have a default editor setting exactly for this use case. Since LARBS already sets a default editor I find it consequential to set a default visudo editor, I mean, why would I bother setting EDITOR=nvim
each time I need to edit a sudoers file?
Please note that the EDITOR
variable will still be honored even if we set a default editor, that allows the user to run whatever editor/command for idiosyncratic use.
The sudoers man page states that:
LARBS doesn't currently set an editor for visudo so it tries to invoke its default (vi, which isn't installed by LARBS), resulting in the following error: