The GNU nano editor FAQ

Table of Contents

1. General

1.1. What is GNU nano?
1.2. What is the history behind nano?
1.3. Why the name change from TIP?
1.4. What is the current version of nano?
1.5. I want to read the manpage without having to download the program!

2. Where to get GNU nano.

2.1. FTP and WWW sites that carry nano.
2.2. RedHat and derivatives (.rpm) packages.
2.3. Debian (.deb) packages.
2.4. By GIT (for the brave).

3. Installation and Configuration

3.1. How do I install the RPM or DEB package?
3.2. Compiling from source: WHAT THE HECK DO I DO NOW?
3.3. Why does everything go into /usr/local?
3.5. nano should automatically run strip on the binary when installing it!
3.6. How can I make the executable smaller? This is too bloated!
3.7. Tell me more about this multibuffer stuff!
3.8. Tell me more about this verbatim input stuff!
3.9a. How do I make a .nanorc file that nano will read when I start it?
3.9b. How about in Win32?

4. Running

4.1. How do I open a file with a name beginning with '+' from the command line?
4.2. Ack! My Backspace/Delete/Enter/Meta/double bucky key doesn't seem to work! What can I do?
4.3. Ack! My numeric keypad's keys don't work properly when NumLock is off! What can I do?
4.4. Ack! When I hold down a Meta key combination for a while, the character of the held key gets inserted now and then. What gives?
4.5. How do I type the F13-F16 keys listed in the help viewer? My keyboard only has F1-F12!
4.6. nano crashes when I type <insert keystrokes here>!
4.7. nano crashes when I resize my window. How can I fix that?
4.8a. With what keystroke can I paste text from the clipboard into nano?
4.8b. When I paste text into a document, each line gets indented further than the last. Why? And how can I stop this?
4.8c. When I paste from Windows into a remote nano, nano rewraps the lines. What gives?
4.9. I've compiled nano with color support, but I don't see any color when I run it!
4.10. How do I make nano my default editor (in Pine, mutt, etc.)?
4.11. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?
4.12. On startup I get a message that says "Detected a legacy nano history file". Now older nano versions can't find my search history!

5. Internationalization

5.1. There's no translation for my language!
5.2. I don't like the translation for <x> in my language. How can I fix it?
5.3. What is the status of Unicode support?

6. Advocacy and Licensing

6.1. Why should I use nano instead of Pico?
6.2. Why should I use Pico instead of nano?
6.3. What is so bad about the older Pine license?
6.4. Okay, well, what mail program should I use then?

7. Miscellaneous

7.1. Where can I ask questions or send suggestions?
7.2. How do I submit a bug report or patch?
7.3. I want to send the development team a big load of cash (or just a thank you).
7.4. How do I join the development team?
7.5. Can I have write access to the GIT tree?


1. General

1.1. What is GNU nano?

GNU nano is designed to be a free replacement for the Pico text editor, part of the Pine email suite from The University of Washington. It aims to "emulate Pico as closely as possible and then include extra functionality".

1.2. What is the history behind nano?

Funny you should ask!

In the beginning...

For years Pine was THE program used to read email on a Unix system. The Pico text editor is the portion of the program one would use to compose his or her mail messages. Many beginners to Unix flocked to Pico and Pine because of their well organized, easy to use interfaces. With the proliferation of GNU/Linux in the mid to late 90's, many University students became intimately familiar with the strengths (and weaknesses) of Pine and Pico.

Then came Debian...

The Debian GNU/Linux distribution, known for its strict standards in distributing truly "free" software (i.e. software with no restrictions on redistribution), would not include a binary package for Pine or Pico. Many people had a serious dilemma: they loved these programs, but the versions available at the time were not truly free software in the GNU sense of the word.

The event...

It was in late 1999 when Chris Allegretta (our hero) was yet again complaining to himself about the less-than-perfect license Pico was distributed under, the 1000 makefiles that came with it and how just a few small improvements could make it the Best Editor in the World (TM). Having been a convert from Slackware to Debian, he missed having a simple binary package that included Pine and Pico, and had grown tired of downloading them himself.

Finally something snapped inside and Chris coded and hacked like a madman for many hours straight one weekend to make a (barely usable) Pico clone, at the time called TIP (Tip Isn't Pico). The program could not be invoked without a filename, could not save files, had no help text display, spell checker, and so forth. But over time it improved, and with the help of a few great coders it matured to the (hopefully) stable state it is in today.

In February 2001, nano was declared an official GNU program by Richard Stallman. nano also reached its first production release on March 22, 2001.

1.3. Why the name change from TIP?

On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program "establishes a full duplex terminal connection to a remote host", and was included with many older Unix systems (and newer ones like Solaris). The conflict was not noticed at first because there is no 'tip' utility included with most GNU/Linux distributions (where nano was developed).

1.4. What is the current version of nano?

The current version of nano should be 2.9.8. Of course, you should always check the nano homepage to see what the latest and greatest version is.

1.5. I want to read the man page without having to download the program!

Jeez, demanding, aren't we? Okay, look here.


2. Where to get GNU nano.

2.1. Web sites that carry nano.

The nano source tarballs can be downloaded from the following web sites:

2.2. RPM packages (RedHat, OpenSuse, and derivatives).

2.3. Deb packages (Debian and derivatives):

Debian users can check out the current nano packages for:

You can also have a look at the Package Pool to see all the available binary and source packages.

2.4. By GIT (for the brave).

For the 'bleeding edge' current version of nano, you can use GIT to download the current source code. Note: believe it or not, by downloading code that has not yet stabilized into an official release, there could quite possibly be bugs, in fact the code may not even compile! Anyway, see the nano GIT document for info on anonymous GIT access to the nano source.


3. Installation and Configuration

3.1. How do I install the RPM or DEB package?

It's simple really! As root, type rpm -Uvh nano-x.y.z-1.i386.rpm if you have a RedHat-ish system or dpkg -i nano_x.y.z-1.deb if you have a Debian-ish system, where x.y.z is the release of nano. There are other programs to install packages, and if you wish to use those, knock yourself out.

3.2. Compiling from source: WHAT THE HECK DO I DO NOW?

Okay, take a deep breath, this really isn't hard. Unpack the nano source with a command like:

tar -xvf nano-x.y.z.tar.gz

Then you need to run configure with any options you might want (if any).

The average case is this:

cd nano-x.y.z/
./configure
make
make install (as root, of course)

3.3. Why does everything go into /usr/local?

Well, that's what the configure script defaults to. If you wish to change this, simply do this:

./configure --prefix=/usr

to put nano into /usr/bin when you run make install.

3.5. nano should automatically run strip on the binary when installing it!

Actually, it does, but you have to use make install-strip. The default make install does not, and will not, run strip automatically.

3.6. How can I make the executable smaller? This is too bloated!

Actually, there are several parts of the editor that can be disabled. You can pass arguments to the configure script that disable certain features. Here's a brief list:

  --disable-browser       Disable the built-in file browser
  --disable-color         Disable color and syntax highlighting
  --disable-comment       Disable the comment/uncomment function
  --disable-extra         Disable the easter egg
  --disable-help          Disable the built-in help texts
  --disable-histories     Disable the saving of search strings and cursor positions
  --disable-justify       Disable the justify/unjustify functions
  --disable-libmagic      Disable the use of libmagic for determining a file's syntax
  --disable-linenumbers   Disable line numbering
  --disable-mouse         Disable mouse support
  --disable-multibuffer   Disable the opening of multiple file buffers
  --disable-nanorc        Disable the use of .nanorc files
  --disable-operatingdir  Disable the setting of an operating directory
  --disable-speller       Disable the spell-checker functions
  --disable-tabcomp       Disable the tab-completion functions
  --disable-wordcomp      Disable the word-completion function
  --disable-wrapping      Disable all hard-wrapping of text

There's also the --enable-tiny option which disables everything above, as well as some larger chunks of the program (like the marker code that you use with Control-^ to select text). Also, if you know you aren't going to be using other languages, you can use --disable-nls to disable internationalization and save a few K to a few dozen K depending on whether you have locale support on your system. And finally, there's always good old strip to strip all debugging code and code that exists in libraries on your system.

With --disable-wrapping-as-root you can disable any hard-wrapping by default when the user is root, useful to prevent accidentally changing long lines in system configuration files.

3.7. Tell me more about this multibuffer stuff!

To use multiple file buffers, you must not have configured nano with --disable-multibuffer nor with --enable-tiny (use nano -V to check the compilation options). Then when you want to insert a file into its own buffer instead of into the current file, just hit Meta-F after typing ^R. If you always want files to be loaded into their own buffers, use the -F or --multibuffer flag when you invoke nano, or add set multibuffer to your .nanorc file.

You can move between the buffers you have open with the Meta-< and Meta-> keys, or more easily without holding Shift: Meta-, and Meta-. (clear as mud, right? =-). When you have more than one buffer open, the ^X shortcut will say "Close", instead of "Exit".

3.8. Tell me more about this verbatim input stuff!

When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press Meta-V (if you're not at a prompt, you'll get the message "Verbatim Input" on the status bar), then press the key(s) that generate the character you want.

Alternatively, if Unicode support is enabled (see section 5.3), you can press Meta-V and then type a six-digit hexadecimal code (from 000000 to 10FFFF, case-insensitive), and the character with the corresponding value will be inserted. The status bar will change to "Unicode Input: ......" when you do this.

3.9a. How do I make a .nanorc file that will be read when I start nano?

It's not hard at all! But, your nano must not have been compiled with --disable-nanorc. Then simply copy the sample.nanorc that came with the nano source or your nano package (most likely in /usr/doc/nano) to .nanorc in your home directory. If you didn't get one, the syntax of the file is simple. Flags are turned on and off by using the words set and unset plus the long option name for the feature. For example, "set nowrap" or "set smarthome".

3.9b. How about in Win32?

If you're using the official nano .zip file and have extracted all the files, you should take the file nano.rc and place it somewhere on your Win32 system (for example, if you have write permission to do so, at the top of C:\). Then you must create an Environment variable called HOME which points to the directory where you put nano.rc. In Windows XP, you can get to Environment variables by right-clicking "My Computer" either on the desktop or in the Start Menu, and selecting Properties. This should bring up the System Properties panel. Then click the Advanced Tab, and there should be a button called Environment Variables. Click that to bring up the Environment Variables section. Now, under User Variables you should be able to click the New button, and make a new Variables Name called HOME, with the Variable Value of whatever path you copied nano.rc into (just the directory name; don't add nano.rc onto the end).

We're still working on documentation for enabling syntax highlighting on Win32; please bear with us.

Note that the nano.rc file must remain Unix-formatted in order for nano to understand it. In other words, you should probably use only nano to edit its config file. Other programs like Wordpad and Notepad will convert the file to DOS format when saving, and the latter does not even properly read Unix-formatted files to begin with.


4. Running

4.1. How do I open a file with a name beginning with '+' from the command line?

If a command-line option that begins with '+' is followed by another option, the former is always treated as a starting line and column number, and the latter is always treated as a filename. If a command-line option that begins with '+' isn't followed by another option, it's always treated as a filename. Examples:

To open '+filename.txt' starting on line 1: nano +filename.txt
To open '+filename.txt' starting on line 10: nano +10 +filename.txt
To open '+filename.txt' starting on line 1, column 20: nano +,20 +filename.txt
To open '+filename.txt' starting on line 10, column 20: nano +10,20 +filename.txt
To open '+filename.txt' starting on line 1 and 'filename.txt' starting on line 40 (if nano has been compiled with multibuffer support): nano +1 +filename.txt +40 filename.txt

4.2. Ack! My Backspace/Delete/Enter/Meta/double bucky key doesn't seem to work! What can I do?

Try setting your $TERM variable to 'vt100'. nano doesn't yet support every term entry under the sun.

Bourne shell users (bash and sh): export TERM=vt100
C Shell users (tcsh and csh): setenv TERM vt100

4.3. Ack! My numeric keypad's keys don't work properly when NumLock is off! What can I do?

You can use the -K or --rebindkeypad option on the command line, or add the line set rebindkeypad to your .nanorc. However, nano's mouse support won't work properly if you do any of these things.

4.4. Ack! When I hold down a Meta key combination for a while, the character of the held key gets inserted now and then. What gives?

This was a bug in how nano handled consecutive escape sequences. It should be fixed since version 2.6.0.

4.5. How do I type the F13-F16 keys listed in the help viewer? My keyboard only has F1-F12!

It depends on the terminal type you're using. On some terminals, such as the FreeBSD console, xterm, konsole, and gnome-terminal, Shift-F1 to Shift-F4 will generate F13 to F16. On other terminals, such as the Linux console, rxvt, and Eterm, Shift-F3 to Shift-F6 will generate F13 to F16.

4.6. nano crashes when I type <insert keystrokes here>!

If you aren't trying some bizarre keystroke combination with some bizarre $TERM entry, chances are you have found a bug. You are welcome to submit it to the nano-devel list or in the bug tracker on Savannah.

4.7. nano crashes when I resize my window. How can I fix that?

Older versions of nano had this problem. Please upgrade to version 2.7.0 or newer.

4.8a. With what keystroke can I paste text from the clipboard into nano?

In most desktop environments Shift+Insert will paste the contents of the clipboard.

4.8b. When I paste text into a document, each line gets indented further than the last. Why? And how can I stop this?

You have the autoindent feature turned on. Hit Meta-I to turn it off, paste your text, and then hit Meta-I again to turn it back on.

4.8c. When I paste from Windows into a remote nano, nano rewraps the lines. What gives?

When pasting from Windows, in some situations linefeeds are sent instead of carriage returns (Enters). And linefeeds are ^Js, which make nano justify (rewrap) the current paragraph. To prevent these linefeeds from causing these unwanted justifications, add this line to your .nanorc on the remote Linux box: unbind ^J main or bind ^J enter main, depending on whether the paste contains CR + LF or only LF.

4.9. I've compiled nano with color support, but I don't see any color when I run it!

If you want nano to actually use color, you have to specify the color configurations you want it to use in your .nanorc. Several example configurations are in the syntax/ subdirectory of the nano source, which are normally installed to /usr/local/share/nano/. To enable all of them, uncomment the line # include "/usr/local/share/nano/*.nanorc" in your nanorc. See also section 3.9a.

4.10. How do I make nano my default editor (in Pine, mutt, etc.)?

You need to make nano your $EDITOR. If you want this to be saved, you should put a line like this in your .bashrc if you use bash (or .zshrc if you believe in zsh):

export EDITOR=/usr/local/bin/nano

or, if you use tcsh, put this in your .cshrc file:

setenv EDITOR /usr/local/bin/nano

Change /usr/local/bin/nano to wherever nano is installed on your system. Type "which nano" to find out. This will not take effect until the next time you log in. So log out and back in again.

Then, on top of that, if you use Pine, you must go into setup (type S at the main menu), and then configure (type C). Hit Enter on the lines that say:

[ ] enable-alternate-editor-cmd
[ ] enable-alternate-editor-implicitly

Then exit (E) and select Yes (Y).

If you're a mutt user, you should see an effect immediately the next time you log in. No further configuration is needed. However, if you want to let people know you use nano to compose your email messages, you can put a line like this in your .muttrc:

my_hdr X-Composer: nano x.y.z

Again, replace x.y.z with the version of nano you use.

4.11. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?

Try holding down the Shift key and selecting or pasting the text as you normally would.

4.12. On startup I get a message that says "Detected a legacy nano history file". Now older nano versions can't find my search history!

In nano 2.3.0, cursor-position history was introduced, and both history files now reside in a .nano subdirectory in your home directory. A newer nano will move an existing search-history file to this new location so it can continue to be used. This means that if you then try and use an earlier version of nano, it will be unable to see your current search history. To fix this, run the following command:

ln -sf ~/.nano/search_history ~/.nano_history

The "migration service" (moving the search-history file to its new location) has been deleted from nano in late 2017, since version 2.9.0. The search-history and position-history files will now be looked for first in ~/.nano/ and, when not found there, then in ~/.local/share/nano/.


5. Internationalization

5.1. There's no translation for my language!

In June 2001, GNU nano entered the Translation Project and since then, translations should be managed from there.

If there isn't a translation for your language, you could ask your language team to translate nano, or better still, join that team and do it yourself. Joining a team is easy. You just need to ask the team leader to add you, and then send a translation disclaimer to the FSF (this is necessary as nano is an official GNU package, but it does not mean that you transfer the rights of your work to the FSF, it's just so the FSF can legally manage them).

In any case, translating nano is easy. Just grab the latest nano.pot file listed on nano's page at the TP, and translate each msgid line into your native language on the msgstr line. When you're done, you should send it to the TP's central PO-file repository.

5.2. I don't like the translation for <x> in my language. How can I fix it?

The best way is to send an e-mail with your suggested corrections to the team's mailing list. The address is mentioned in the Language-Team: field in the relevant PO file. The team leader or the assigned translator can then make the changes reach the nano-devel list.

5.3. What is the status of Unicode support?

Unicode should be fully usable nowadays. When the encoding of your terminal is set to UTF-8, and your locale (mainly the LANG environment variable) is UTF-8 too, then you should be able to read, enter and save Unicode text.


6. Advocacy and Licensing

6.1. Why should I use nano instead of Pico?

There are many reasons to use nano instead of Pico. A more complete list can be found at the nano homepage.

6.2. Why should I use Pico instead of nano?

Again, check out the nano homepage for a good summary of reasons. It really is a matter of personal preference as to which editor you should use. If you're the type of person who likes using the original version of a program, then Pico is the editor for you. If you don't mind sacrificing mailer integration with Pine, and are looking for a few more features, as well as a 'better' license in terms of adding your own changes, nano is the way to go.

Note that the last of these no longer applies to the new version of Pine, Alpine, which is under the Apache License, version 2.0.

6.3. What is so bad about the older Pine license?

The U of W license for older versions of Pine and Pico is not considered truly Free Software according to both the Free Software Foundation and the Debian Free Software Guidelines. The main problem regards the limitations on distributing derived works: according to UW, you can distribute their software, and you can modify it, but you can not do both, i.e. distribute modified binaries.

6.4. Okay, well, what mail program should I use then?

If you are looking to use a Free Software program similar to Pine, and Emacs is not your thing, you should definitely take a look at mutt. It is a full-screen, console based mail program that actually has a lot more flexibility than Pine, but has a keymap included in the distribution that allows you to use the same keystrokes as Pine would to send and receive mail. It's also under the GNU General Public License, version 2.0.

Of course, due to the license change you can now use the Alpine distribution of PINE as it is now considered Free Software, but you would be sacrificing many of nano's features to do so.


7. Miscellaneous

7.1. Where can I ask questions or send suggestions?

There are three mailing lists for nano hosted at Savannah: info-nano, help-nano and nano-devel. info-nano is a very low traffic list where new versions of nano are announced (surprise!). help-nano is for getting help with the editor without needing to hear all of the development issues surrounding it. nano-devel is a normally low, sometimes high traffic list for discussing the present and future development of nano. Here are links to where you can sign up for a given list:

info-nano - http://mail.gnu.org/mailman/listinfo/info-nano/
help-nano - http://mail.gnu.org/mailman/listinfo/help-nano/
nano-devel - http://mail.gnu.org/mailman/listinfo/nano-devel/

7.3. How do I submit a bug report or patch?

The best way to submit bugs is through the Savannah bug tracker, as you can check whether the bug you are reporting has already been submitted, and it makes it easier for the maintainers to keep track of them.

You can submit patches for nano via Savannah's patch manager.

7.3. I want to send the development team a big load of cash (or just a thank you).

That's fine. Send it our way! Better yet, fix a bug in the program or implement a cool feature and send us that instead (though cash is fine too).

7.4. How do I join the development team?

The easiest way is to consistently send in good patches that add some needed functionality, fix a bug or two, and/or make the program more optimized/efficient. Then ask nicely and you will probably be added to the Savannah development list and be given write access after a while. There is a lot of responsibility that goes along with being a team member, so don't think it's just something to add to your resume.

7.5. Can I have write access to the git tree?

Re-read section 7.4 and you should know the answer.