Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Most text editors have a setting for converting tabs to spaces. How would this be done in pico?

share|improve this question
up vote 1 down vote accepted

Not a direct answer, but in case Pico can't do this, how about Nano?

Quoting its man page:

nano is a small, free and friendly editor which aims to replace Pico, the default editor included in the non-free Pine package. Rather than just copying Pico's look and feel, nano also implements some missing (or disabled by default) features in Pico, such as "search and replace" and "go to line and column number".

...and, more importantly,

   -E (--tabstospaces)
          Convert typed tabs to spaces.
   -T cols (--tabsize=cols)
          Set  the  size  (width)  of a tab to cols columns.  The value of
          cols must be greater than 0.  The default value is 8.

Edit As manatwork pointed out (see comments), these can be set in the config, nanorc:

   set tabsize n
      Use a tab size of n columns.  The value of n must be greater than 0.
      The default value is 8.

   set/unset tabstospaces
      Convert typed tabs to spaces.
share|improve this answer
You could also mention set tabsize n and set/unset tabstospaces, maybe even quote the relevant parts of man nanorc. – manatwork May 22 '12 at 14:02
Thanks for the hint :) – sr_ May 22 '12 at 14:04
Perfect. I don't care about nano vs pico, I just need a friendly terminal editor that kids can use. – Eric Wilson May 22 '12 at 14:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.