» Change the default editor

Ever wanted to change the crontab of a server, but got an editor on screen that you're totally unfamiliar with? There are a lot of causes for this annoyance, but one is that somebody recently installed or used midnight commander (mc) which for whatever reason seams to overrule your session's default editor.

Changing the editor

The first time it took me a while to figure it out so I thought lets make it an article on my site, so maybe it will help others save some time.

Anyhow, here how to change it, just open your terminal and type

export EDITOR="pico"

pico can be pico, vim, or another text editor of your choice of course.

Make it permanent

If the problem persists, you might want to add the export to your .bashrc file, or even to the /etc/profile file. But that seems a bit radical since that's system-wide :)

Debian / Ubuntu

As noted by Roland below, on Debian / Ubuntu you can use:

sudo update-alternatives --config editor

Much better!

You probably shouldn't follow me


Like this Article?

I'd appreciate it if you leave a comment, spread the word, or consider a small donation


tags: bash, text editor, midnight commander, pico, vim, linux
category: Howto - Webserver
read: 22,554 times

Add comment

(required, shown)(required, not shown)for syntax highlighting

[CODE="Javascript"]
your_code_here();
[/CODE]

Replace "Javascript"
with "php", "text", etc.
code (to make sure you are not a spammer)

 Track replies: rss feed comments feed

Comments

#6. neeraj on 11 January 2012

Gravatar.com: neerajI have gone through your site and find that
You are simply a great person....
Good Work and keeping posting ...

God Bless U :)
... [more]
--neeraj

#5. Ashish Sood on 23 May 2010

Gravatar.com: Ashish SoodUsefull topic
thanks Alot

#4. Buddhika on 10 February 2009

Gravatar.com: BuddhikaThank a lot that is very usefull

#3. jonw on 11 December 2008

Gravatar.com: jonwThanks for that tip... Worked perfectly.

#2. Kevin on 25 November 2008

Twitter.com: kvz@ Roland: Didn't know that, only used it for java so far. Thanks Roland!

#1. Roland on 18 November 2008

Gravatar.com: Rolandon Debian orUbuntu you can use:
sudo update-alternatives --config editor