#1  
Old 3rd February 2007, 21:22
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Post Editor Change

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.
Reply With Quote
Sponsored Links
  #2  
Old 4th February 2007, 12:27
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

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
Reply With Quote
  #3  
Old 4th February 2007, 13:11
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by martinfst
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 ??
Reply With Quote
  #4  
Old 4th February 2007, 13:15
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

How do you invoke the "default" editor?
Reply With Quote
  #5  
Old 4th February 2007, 13:18
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by martinfst
How do you invoke the "default" editor?
On openSuse 10.2 the default editor is vim (i believe), but i als0 want to use as root the nano editor.
Reply With Quote
  #6  
Old 4th February 2007, 13:20
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

But you can. Just type
Code:
nano <filename>
Or am I mis-understanding you? Sorry.
Reply With Quote
  #7  
Old 4th February 2007, 13:24
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by martinfst
But you can. Just type
Code:
nano <filename>
Or am I mis-understanding you? Sorry.
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.
Reply With Quote
  #8  
Old 4th February 2007, 13:38
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

For
Code:
crontab -e
you need to set the VISUAL environment variable as mentioned before. Works on my Ubuntu/Debian systems.
Reply With Quote
  #9  
Old 4th February 2007, 13:50
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by martinfst
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 ??
Reply With Quote
  #10  
Old 4th February 2007, 14:00
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
 
Default

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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.