GNU nano is an easy to use text editor with additional functionality. nano is Gentoo's default editor, means, it is part of each installation. But you can replace it without problems with any other editor.
|USE flag (what is that?)||Default||Recommended||Description|
||No||No||Enable debug messages and assert warnings. Note that these will all be sent straight to stderr rather than some logging facility.|
||No||Enable justify/unjustify functions for text formatting.|
||No||Add magic file support (sys-apps/file) to automatically detect appropriate syntax highlighting|
||No||No||Disable all fancy features, including ones that otherwise have a dedicated USE flag (such as spelling).|
||Yes||Add ncurses support (console display library)|
||Yes||Add Native Language Support (using gettext - GNU locale utilities)|
||No||Add support for the slang text display library (it's like ncurses, but different)|
||Yes||Add dictionary support|
||Yes||Add support for Unicode|
emerge --ask nano
Start nano by typing in your terminal nano followed by options. The most common option is a file name and path, e.g.:
Nano now shows the content of the text file and you can edit the file. Navigate through the text with the arrow keys.
At the bottom nano shows shortcuts for common actions, e.g. save or exit. The shortcut to save is shown as "^O". You have to prefix the shortcut with the Ctrl key, so to save press Ctrl+O. To exit press Ctrl+X.
To edit configuration files always use the -w option. Without that option long lines are wrapped and, when saving, are saved wrapped. This breaks your config files.
To see an overview over all options run nano --help.
Cut, Copy and Paste
You can cut a line with the shortcut Ctrl+K (copy with Alt+^) and paste it with Ctrl+U. To cut / copy multiple line also press the shortcut multiple times.
Search the text with Ctrl+W. Continue the search with Alt+W.
|Show the help||Ctrl+G||F1|
|Copy line to clipboard||Alt+^||Alt+6|
|Cut line to clipboard||Ctrl+K||F9|
|Paste line from clipboard||Ctrl+U||F10|
Set options permanently in the /etc/nanorc. This configuration applies system wide to all users. To change an options only for one user, set the option in the user's ~/.nanorc. It overrides system wide settings.