About Linux FAQ

Browse More FAQs:

Change default Linux / UNIX text editor from VI to Pico

Posted by Vivek Gite [Last updated: August 30, 2007]

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

E-mail this to a friend      Printable version

Related Other Helpful FAQs:

Discussion on This FAQ

  1. soraver Says:

    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)

  2. Dan Says:

    Thanks for the handy reference!

  3. John Says:

    Thanks for the help. Very useful and concise explanation.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.