LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 12-19-2007, 06:44 AM   #1
graziano1968
Member
 
Registered: Sep 2004
Posts: 223

Rep: Reputation: 30
how to change default editor


Hello

how to change default editor when I use crontab for example.

I wish to change the default editor from vi to pico , how to do that please ?

Thank you!
 
Old 12-19-2007, 06:49 AM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 46
In your .bashrc or .bash_profile, add the following...
Code:
EDITOR=pico
export EDITOR
It will take effect next time you login.

You can also run "export EDITOR=pico" for this login.

Last edited by ranger_nemo; 12-19-2007 at 06:54 AM.
 
Old 12-19-2007, 08:47 AM   #3
graziano1968
Member
 
Registered: Sep 2004
Posts: 223

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by ranger_nemo View Post
In your .bashrc or .bash_profile, add the following...
Code:
EDITOR=pico
export EDITOR
It will take effect next time you login.

You can also run "export EDITOR=pico" for this login.
THANK YOU!
 
Old 12-19-2007, 08:43 PM   #4
pengaru
LQ Newbie
 
Registered: Dec 2007
Distribution: GNU/Linux
Posts: 9

Rep: Reputation: 0
if your distribution uses the "alternatives" indirection facility, you can set it system-wide by changing the symlink in: /etc/alternatives/

e.g.
lrwxrwxrwx 1 root root 12 Oct 29 05:29 /etc/alternatives/editor -> /usr/bin/vim


vi flavor is also set in /etc/alternatives:
lrwxrwxrwx 1 root root 18 Aug 5 2006 /etc/alternatives/vi -> /usr/bin/vim.basic



this works by replacing the traditional locations with symlinks referencing another level of symlinks in /etc/alternatives.

/usr/bin/vi is now a symlink to /etc/alternatives/vi, so whatever /etc/alternatives/vi becomes the flavor executed when people simply type 'vi' into bash.

The above examples are from Debian etch.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the default crontab editor kawatom Red Hat 5 03-06-2011 01:07 PM
Gnome is not Allowing me to Change its Default Text Editor rickh Linux - Desktop 2 06-02-2007 10:21 AM
Is it possible to change the default text editor? Gethyn Slackware 2 09-05-2006 05:08 PM
how to change default SUDO editor??? orgee Linux - Software 3 10-12-2004 07:39 PM
how can I change the default editor (vipw, crontab -e) or pager? Xavius Linux - Newbie 1 04-05-2004 01:45 PM


All times are GMT -5. The time now is 08:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration