[ Table of Contents ] [ Front Page ] [ Prev ] [ Linux Gazette FAQ ] [ Next ]

"Linux Gazette...making Linux just a little more fun!"

From Pico to Nano


The Slightly Bigger Editor

By Sven Guckes

The program "Pine" has become a popular program for both Email and News. It makes use of a small and simple editor named "pico".

Pico's command set only has a dozen commands and it shows the most useful commands in the last two lines of the display:

   UW PICO(tm) 3.5                New Buffer


^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Pg   ^K Cut Text  ^C Cur Pos
^X Exit      ^J Justify   ^W Where is  ^V Next Pg   ^U UnCut Text^T To Spell

However, the source code for Pico is closely linked to the source code of Pine; therefore you cannot download Pico on its own - you have to donwload the source of the complete newsreader to install the little editor. Worse: Although Pine is freely available you should know this:

Pine and Pico are not "OpenSource"

Pico is dead - long live Nano

Yes, you cannot just download the source for Pico and install on its own. However, many users would like to use this kind of editor and simply copy it everywhere for personal use.

That's why there is now an OpenSource project for a "Pico clone" - "Nano". (Think of it as "'n another editor", if you like.)

The goal of Nano is to make a small editor like Pico available under the GNU General Public Licence and to add some important commands, while keeping the design, ie "small and beautiful".

The Editor's New Clothes

Here is a screenshot of nano:

   nano 0.8.1                     New Buffer


^O Write Out ^_ Goto Line ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos
^X Exit      ^\ Replace   ^W Where Is  ^V Next Page ^U Uncut Txt ^T To Spell

The difference to pico is subtle - no more copyright by the University of Washington ["UW ... (tm)"]. :-)

Also, the WriteOut command now is above the Exit command, so you can see both "exit commands" in one column.

The new commands are in the second column - GotoLine and Replace.

The Help command is still available with Control-G - but when you invoke it then you will see this message:

        [ Help function not yet implemented, nyah! ]
But as with all program which develop fast - the documentation is usually missing.

But do not despair - there's help on the command line:

$ nano -h Usage: nano [GNU long option] [option] +LINE <file> Option Long option Meaning -V --version Print version information and exit -c --const Constantly show cursor position -h --help Show this message -i --autoindent Automatically indent new lines -s [prog] --speller=[prog] Enable alternate speller -t --tempfile Auto save on exit, don't prompt -v --view View (read only) mode -w --nowrap Don't wrap long lines -x --nohelp Don't show help window -z --suspend Enable suspend +LINE Start at line number LINE All these switches are pretty nice, of course. Try them! Maybe we will see these lines in some Unix programs from now on:
        set editor="nano -citxz"

What's your version?

One of the things I like about program is that they identify themself by their version (and relase date):

$ nano -V
  nano version 0.8.0 by Chris Allegretta
Soon this will hopefully show both important addresses - that of the website and the email address:

$ nano -V
  nano 0.8.0 http://go.to/nano-editor nano-editor@go.to by Chris Allegretta

Smaller, Faster, Better

You may now that "nano" and "pico" are used in the decimal system for fractions like "centi" and "milli"; "nano" stands for "a billionth" (ie 10^(-9)), and "pico" stands for "one trillionth" (ie 10^(-12)).

So, although "nano" is bigger than "pico" I hope that nano will both be smaller in source as well as in binary size.

A quick look at history

As of Jan 31th, 2000, the current version is nano-0.8.1 and the tape GNU-zipped archive has about 72 kilobytes.

        date	size	name-version
        ====	====	============
        000110	56k     nano-0.7.4
        000113  56k     nano-0.7.5
        000116  58k     nano-0.7.7
        000119  60k     nano-0.7.8
        000123  67k     nano-0.7.8
        000124  68k     nano-0.7.9
        000125  70k     nano-0.8.0
        000129  72k     nano-0.8.1
On average each version adds 2K - so when nano-1.0.0 gets released it should be around 110k. ;-)


The author distributes RPMs for Nano now. However, there is no ftp site which carries Nano yet. So if you would like to install your own nano binary then you could use a browser to download Nano - or simply the nice tool "wget":

   wget http://faculty.plattsburgh.edu/astyanax/nano/dist/nano-0.8.1.tar.gz
Unpack with GNU tar:
   gtar xvvzf nano-0.8.1.tar.gz
.. and run the configure script and make the binary:
   cd nano-0.8.1
The installation is pretty fast. :-)

Now strip the binary:

guckes@linux> ls -l nano
-rwx--x--x   1 guckes   users      120357 Jan 31 21:31 nano
guckes@linux> strip nano
guckes@linux> ls -l nano
-rwx--x--x   1 guckes   users       38232 Jan 31 21:34 nano
Only 38K!

guckes@linux> ls -l =pico
-rwxr-xr-x   1 root     root       159576 Aug 13 02:23 /usr/bin/pico
Yes, Pico is bigger!

And if someone asks you why people delight in nanotechnology - now you know. Enjoy Nano!

Discussing Nano

As far as I know there is no mailing list for the development of Nano yet. Therefore please use the newsgroup comp.editors to discuss Nano.

However, I am pretty sure that the news about Nano will hit the newsgroup comp.mail.pine pretty soon. I expect many users of Pine to switch to using Nano instead of Pico. Expect crossposts - so please direct followups from comp.mail.pine:

	Followup-To: comp.editors


The Big Future

The author, Chris Allegretta, is currently working towards "Internationalization" (I18N) of nano you should be able to edit and see text of other languages which require the space of two characters to make up one symbol in language.

Also, an interface to "spell checking" is in the works. This needs lots of testing , of course. So all you nerds with strange language - please help checking and testing this code!

Personally, I hope that these commands will be added:

Links and addresses

Chris Allegretta  allegrcr@plattsburgh.edu
Nano editor maintainer

http://go.to/nano-editor or (currently)
Nano editor HomePage (run by Chris Allegretta)

Nano editor distribution location (only HTTP - no FTP or FTP mirrors yet)

Nano editor RPMs

Pico editor page (run by Sven Guckes)

Sven Guckes       guckes-nano@math.fu-berlin.de
Author of this article and evangelist for text based programs
such as elm, irc, lynx, mutt, nn, screen, slrn, vim, zsh.
Email since 1989, Usenet since 1992.  Webmaster of slrn.org, vim.org.

Copyright © 2000, Sven Guckes
Published in Issue 50 of Linux Gazette, February 2000

[ Table of Contents ] [ Front Page ] [ Prev ] [ Linux Gazette FAQ ] [ Next ]