Nano (or nano) is a text editor which aims to introduce a simple interface and intuitive command options to console based text editing. nano is the default console editor in distributions such as [http://www.ubuntu.com/ Ubuntu] and supports features including colorized syntax highlighting, DOS/Mac file type conversions, spellchecking and [http://en.wikipedia.org/wiki/UTF-8 UTF-8] encoding. nano opened with an empty buffer typically occupies under 1.5 MB of resident memory. [http://i275.photobucket.com/albums/jj281/adamchrista/Arch%20Linux/Wiki%20Examples/nano-man.png nano Screenshot].

+

[http://www.nano-editor.org/ 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 is the default console editor in distributions such as [http://www.ubuntu.com/ Ubuntu] and supports features including colorized syntax highlighting, DOS/Mac file type conversions, spellchecking and [http://en.wikipedia.org/wiki/UTF-8 UTF-8] encoding. nano opened with an empty buffer typically occupies under 1.5 MB of resident memory. [http://i275.photobucket.com/albums/jj281/adamchrista/Arch%20Linux/Wiki%20Examples/nano-man.png nano Screenshot].

= Package Installation =

= Package Installation =

Revision as of 04:28, 28 August 2010

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Introduction

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 is the default console editor in distributions such as Ubuntu and 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 1.5 MB of resident memory. nano Screenshot.

Configuration

Creating ~/.nanorc

The look, feel and function of nano is typically controlled by way of either command-line arguments, or configuration commands within the file ~/.nanorc.
A sample configuration file is installed upon program installation and is located at /etc/nanorc.The file ~/.nanorc must be first created by the user:

Suggested Configuration

Suspension

Unlike most interactive programs, suspension is not enabled by default. To change this, uncomment the 'set suspend' line in '/etc/nanorc'. This will allow you to use the keys ctrl+z to send nano to the background.

nano Usage

Special Functions

Ctrl key modified shortcuts (^) respresenting commonly used functions are listed along the bottom two lines of the nano screen.

Tips & Tricks

Replacing vi with nano

Casual users may prefer the use of nano over vi for its simplicity and ease of use and may opt to replace vi with nano as the default text editor for commands such as visudo.

Method One

Warning: From man 8 visudo: Note that this can be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or EDITOR.

sudo from the core repository is compiled with --with-env-editor by default and honors the use of the VISUAL and EDITOR variables. To establish nano as the visudo editor for the duration of the current shell session, set and export the EDITOR variable before calling visudo

export EDITOR=nano

Example Usage

export EDITOR=nano && sudo visudo

Method Two

Warning: From man 8 visudo: Note that this can be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or EDITOR.

The EDITOR variable can also be set within the following files for persistent use: