I want to change the editor of visudo from nano to vim;
I have read the Arch wiki:
but nothing seems to work: visudo always launches nano
(I’m much more familiar with vim/vi than with nano).
Can it be that nano is hardcoded into visudo?
su # <<< Enter password
su #enter root password
You could add
sudoers file to make it permanent.
I have done exactly this but visudo launches nano, not vim.
The best “solution” for me is:
$ sudo -s
# EDITOR=vim visudo
all I want is a one-liner like
and visudo launching vim, not nano
fact is: sudo changes to nano and I don’t know why:
$ export EDITOR=vim
$ echo $EDITOR
$ sudo -s
# echo $EDITOR
why und how can I change this?
Check your bashrc / /etc/environment / .profile to find where $EDITOR is set and change it.
/etc/environment was it.
after the change from
visudo behaves as wished.
many thanks for your help!!
Please mark @xircon’s post as solution by clicking on … and checking the box.
This would help other users looking for solution to similar issue to more easily find one.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.