editor for visudo
Ubuntu 9.04
I have a sudoer user I've tried to add export VISUAL=vi (also I tried to add EDITOR=vi; export EDITOR) to .profile , .bash_profile, .bashrc of that sudoer user. But nano is still a default editor. Only when I add export VISUAL=vi to /etc/profile the default editor becomes VI (but only for ROOT user). I'm trying all this under true console and after editing profiles I relogin. Where am I wrong please? |
How are you invoking visudo?
|
sudo visudo
|
Hello,
visudo looks at /usr/bin/editor for which editor is to be used. You can change it using: Code:
update-alternatives --config editor Code:
Sorry, forgot to mention: on Ubuntu when not root use sudo. Kind regards, Eric |
I guess it is because when you invoke sudo your env variables are not carried over.
... quick "man sudo"... What if you invoke it as Code:
sudo -E visudo |
sudo -E visudo
works great. It's the first time (amongst many books and howtos) when I hear about -E option. Now I doubt what to learn - mans or books? Ofcourse I understand that all people here will say MANs... Thanks you all for your replies. |
For details like that, man pages, otherwise you'd have to buy a lot(!) of books.
I find this one is easy to use/read http://linux.die.net/man/ Here's a long list of online free to read books http://www.linuxtopia.org/online_books/index.html Enjoy :) |
Thank you chrism01 for the links!
|
All times are GMT -5. The time now is 04:25 AM. |