The 'nano' editor is a GNU-project editor based on 'pico' a simple but easy to use editor created for the PINE email program for creating and editing emails. It has been expanded quite a bit: there is enhanced navigation, and search which include regex search.
A great addition, especially if you connect to SDF on a color terminal, is nano's use of “syntax” files, which provide syntax highlighting for several programming languages and related filetypes, such as HTML files, shell scripts, shell resource files (like
.bashrc) and even the nano resource file
.nanorc, where the settings for syntax file are kept.
To activate syntax highlighting, we are going to copy the default
nanorc file to your user space and edit it. The steps are:
nanorcto your local as a resource file,
.nanorc(yes, with the dot)
cp /usr/pkg/share/nanorc ~/.nanorc
# include “/usrIt will take you to a line that looks like:
# include "/usr/pkg/share/nano/nanorc.nanorc"
# Cascading Style Sheets # include "/usr/pkg/share/nano/css.nanorc"
## HTML # include "/usr/pkg/share/nano/html.nanorc"
## PHP # include "/usr/pkg/share/nano/php.nanorc"
ctl-xand press 'Y' at the save prompt and press enter to confirm you are saving the file as
The next time you open nano on an HTML or other file (it keys off the file extension, like
index.html), you should see the code hightlighted, which should help your editing significantly!
Nano, like 'pico', has Help. So if you start with the pico cheatsheet and read the Help, you'll get what you need.
As of nano 6.4 suspend behavior was changed. Instead of
ctl-z (also typed ^z, in the nano menu itself) being suspend as it was before, typing
^z warns you that you need to to
^t^z if you
'really' mean to suspend.
You can reset to the old way by putting this in your .nanorc. That makes
^z suspend again.
## Allow nano to be suspended with ''^z'' the old way, not ''^t^z' bind ^Z suspend main