Change default Linux / UNIX text editor from VI to Pico

by Vivek Gite on August 30, 2007 · 5 comments

Q. I find vi hard to use. How do I change my default text editor from vim / vi to Pico under Debian Linux?

A. To use and change an editor to edit your text message, set the variable EDITOR to the pathname of the vi / vim binary file. You need to use export or set command for the same purpose.

Many Linux / UNIX command read shell EDITOR environment variable to determine which editor to use for editing a text file.

Set default text editor to pico

Type the command as follows:
$ which pico
Output:

/usr/bin/pico

Now setup a new text editor:
export EDITOR=/usr/bin/pico
OR
export EDITOR=pico

Add above line to ~/.bashrc file:
$ vi ~/.bashrc
Append text as follows:
export EDITOR=pico
Close and save the file. There is no no need to reboot system.

Also you can add alias if you want:
alias vi=/usr/bin/pico

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 5 comments… read them below or add one }

1 soraver May 6, 2008

just a small suggestion:
alias pico=’nano -w’

thats because not every distro has pico symlinked to nano (nano is the open source pico) and because nano by default wraps long lines (-w).

also someone might be interested in seting TERM to linux
export TERM=linux
so he can use home/end/delete and numpad correctly in nano and also in shell

hope im not too much offtopic (a)

Reply

2 Dan July 6, 2008

Thanks for the handy reference!

Reply

3 John August 6, 2008

Thanks for the help. Very useful and concise explanation.

Reply

4 Stan July 8, 2011

“alias vi=/usr/bin/pico”

Blasphemy!!

But thanks… I needed the editor variable info :).

Reply

5 Slobo January 26, 2012

Thanks a hundred thousand times! I hate vim !!!

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 14 + 15 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: