Nano is a simple command-line text editor inspired by Pico and included by default in the most Linux distributions. It aimed to “emulate Pico as closely as is reasonable and then include extra functionality”. Released as free software by Chris Allegretta in 1999, today nano is part of the GNU Project.
Besides basic text editing, nano offers features like undo/redo, syntax highlighting, interactive search-and-replace, auto-indentation, line numbers, word completion, file locking, backup files, and internationalization support.
Related: Micro Text Editor: Lightweight and Intuitive Terminal-Based Editor
Nano is an editor that prioritizes a low learning curve and ease of use. It’s most useful for people who don’t spend enough time in editors to merit learning something more powerful or versatile.
Related: Differences Between Vi And Vim Text Editors Explained
What’s New in GNU nano 5.9
The nano editor provides syntax highlighting for a few languages and scripts by itself. You can discover which languages are available in nano to highlight its syntax by checking the contents of the /usr/share/nano/
directory.
The new update, called “El manicomio ha decidido: maรฑana sol!”, adds syntax highlighting for YAML files.
To enable syntax highlighting in nano, link them to your user’s nano configuration file ~/.nanorc
. For example, to enable PHP syntax highlighting:
include /usr/share/nano/php.nanorc
Code language: PHP (php)
In nano 5.9 the extension of a filename is added to the name of a corresponding temporary file, so that spell checking a C file, for example, will check only the comments and strings (when using ‘aspell’).
Another useful innovation in nano 5.9 is that now the process number is added to the name of an emergency save file, so that when multiple nanos die they will not fight over a filename.
Furthermore undoing a cutting operation in nano 5.9 will restore an anchor that was located in the cut area to its original line. Also when using --locking
, saving a new buffer will create a lock file.
A full changelog for the new update can be found here and downloads are available here.