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:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 5 comments… read them below or add one }
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)
Thanks for the handy reference!
Thanks for the help. Very useful and concise explanation.
“alias vi=/usr/bin/pico”
Blasphemy!!
But thanks… I needed the editor variable info :).
Thanks a hundred thousand times! I hate vim !!!