How can i change which editor is the default on opensuse 10.2. I want to use nano instead of vi (vim). Thanks in Advance.
In the bash shell you can set the default editor by Code: export VISUAL=/bin/nano . If you want this to be automatic, add this line to the login script in your home directory Code: ~/.bashrc
With the above mentioned solution you can set the editor for every seperate user, but what do you need to do, to set nano as the default editor for every user ??
On openSuse 10.2 the default editor is vim (i believe), but i als0 want to use as root the nano editor.
The problem I have is, when i want to edit a cronjob for a user (crontab -u user -e) then you don't have the control over the editor you want to use. Suse then opens the cronjob in Vim.
For Code: crontab -e you need to set the VISUAL environment variable as mentioned before. Works on my Ubuntu/Debian systems.
Oke, I agree with you, but now i need to put the Code: EXPORT VISUAL=/bin/nano in the ~/.bashrc for the root user, but where can i find this for the root user ??
When you are on the system as root (either by logging in directly or by 'su -' or similar), use the command Code: cd ~ . It will take you to the home dir of the effective user. Then Code: nano .bashrc edit and you're done. If you login as a regular user 1st and the 'upgrade' yourself, you can also edit the .bashrc file of the regular user. Environment variables are promoted to sub-shells.
Thanks Martin, I had to change a little bit to get it working under opensuse 10.2 Code: export VISUAL=/usr/bin/nano Log off and on and it works