GNU nano (or nano) is a text editor which aims to introduce a simple interface and intuitive command options to console based text editing. nano supports features including colorized syntax highlighting, DOS/Mac file type conversions, spellchecking and UTF-8 encoding. nano opened with an empty buffer typically occupies under 4 MB of resident memory.
Install the package.
The look, feel, and function of nano is typically controlled by way of either command-line arguments, or configuration commands within the file
A sample configuration file is installed upon program installation and is located at
/etc/nanorc. To customize your nano configuration, first create a local copy at
$ cp /etc/nanorc ~/.config/nano/nanorc
Proceed to establish the nano console environment by setting and/or unsetting commands within
Nano ships with predefined syntax highlighting rules, defined in
/usr/share/nano/extra/*.nanorc. To enable them, add the following line to your
~/.config/nano/nanorc or to
include "/usr/share/nano/*.nanorc" include "/usr/share/nano/extra/*.nanorc"
For syntax highlighting enhancements which replace and expand the defaults, install or AUR and, additionally to the above setting, also add:
/usr/share/nano-syntax-highlighting/nanorc.nanorc. To temporarily solve the issue, You can run:
# sed -i 's/icolor brightnormal/icolor normal/g' /usr/share/nano-syntax-highlighting/nanorc.nanorc
Save https://paste.xinu.at/4ss/ (similar to Arch's old svntogit server) to
/etc/nano/pkgbuild.nanorc and include it:
Unlike most interactive programs, suspension is not enabled by default. To change this, uncomment the
set suspendable line in
/etc/nanorc. This will allow you to use the keys
Ctrl+z to send nano to the background.
Shortcuts can be viewed from inside nano. See the nano online help files via
Ctrl+g within nano and the nano Command Manual for complete descriptions and additional support.
See also the cheatsheet for nano.
Keyboard shortcuts representing commonly used functions are listed along the bottom two lines of the nano screen.
They can be toggled by:
Tips and tricks
Replacing vi with nano
export VISUAL=nano export EDITOR=nano
Some window managers have keybindings that conflict with nano, for example
Alt+Enter. Remove or remap them to e.g
Super (with for , and ) and restart the window manager.