from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

86344

userrating:

average rating: 1.2 (52 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tutorials per portage category->app-editors->nano

Configuring the nano text editor


nano is a small, free and friendly editor which aims to replace Pico, the default editor included in the non-free Pine package. Rather than just copying Pico's look and feel, nano also implements some missing (or disabled by default) features in Pico, such as "search and replace" and "goto line number".

Lets go ahead and configure it.

($:~)=> nano -w ~/.nanorc
# Use auto-indentation  
set autoindent

# Backup files to filename~
set backup

# Use cut to end of line with ^K by default
set cut

# Enable ~/.nano_history for saving and reading search/replace strings.
# set historylog

# Don't convert files from DOS/Mac format
set noconvert

# Don't follow symlinks when writing files
# set nofollow

# Don't display the help lists at the bottom of the screen
# set nohelp

# Don't wrap text at all
set nowrap

# Use smooth scrolling as the default
set smooth

# Use this spelling checker instead of the internal one. This option
# does not properly have a default value.
set speller "aspell -c"

# Allow nano to be suspended with ^Z
# set suspend

# Use this tab size instead of the default; it must be greater than 0
# set tabsize 8

# Save automatically on exit, don't prompt
# set tempfile

# Enable ~/.nano_history for saving and reading search/replace strings.
# set historylog

# Disallow file modification, why would you want this in an rc file? ;)
# set view

#Color Syntax Highlighting
syntax "c-file" "\.(c|h)$"
color red "\<[A-Z_]{2,}\>"
color green "\<(float|char|int|void|static|const|struct)\>"
color brightyellow "\<(if|while|do|else|case|switch)\>"
color brightcyan "^#( )*(define|include|ifn?def|endif|elif|else|if)"
color brightyellow "<[^= ]*>" ""(.|[^"])*""
color brightyellow start=""(\\.|[^\"])*\\( | )*$" end="^(\\.|[^\"])*""
color brightblue "//.*"
color brightblue start="/\*" end="\*/"

syntax "HTML" "\.html$"
color blue start="<" end=">"
color red "&[^; ]*;"

syntax "TeX" "\.tex$"
color green "\\.|\\[A-Za-z]*"
color magenta "[{}]"
color blue "%.*"

syntax "mutt"
color green "^>.*"

syntax "php" ".*/*.php$"
color brightwhite "\{|\}|\."
color red "('[^']*')"
color red "\"[^\"]*\""
color brightblue "(\$([[:alpha:]_]|->)*)"
color brightgreen "((\$(([[:alpha:]_0-9])+\->)+)[[:alpha:]_0-9]+\()"
color yellow " (if|else if|else|return|case|break)"
color yellow "\|\||\?|!|\||&&|=|;|\(|\)"
color red "false|true"
color brightwhite "[[:space:]]+debug|[[:space:]]+echo|\$this\->debug"
color cyan "//.*"
color cyan start="/\*" end="\*/"

syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
color cyan "^\.ds [^ ]*"
color cyan "^\.nr [^ ]*"
color brightmagenta "\\."
color brightmagenta "\\f."
color brightmagenta "\\f\(.."
color brightmagenta "\\s(\+|\-)?[0-9]"
color cyan "(\\|\\\\)n."
color cyan "(\\|\\\\)n\(.."
color cyan start="(\\|\\\\)n\[" end="]"
color brightgreen "^\. *[^ ]*"
color yellow "^\.\\\".*$"
color green "(\\|\\\\)\*."
color green "(\\|\\\\)\*\(.."
color green start="(\\|\\\\)\*\[" end="]"
color brightred "\\\(.."
color brightred start="\\\[" end="]"
color brightcyan "\\\\\$[1-9]"

syntax "perl" "\.p[lm]$"
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o
|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork)|get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid
|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|
int|ioctl|join|keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop
|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek|seekdir|se(lect|mctl|mget|
mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|st
udy|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr|y|truncate|umask|un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
color cyan start="[$@%]" end="( |\\W|-)"
color yellow "".*"|qq\|.*\|"
color white "[sm]/.*/"
color white start="(^use| = new)" end=";"
color green "#.*"
color yellow start="<< 'STOP'" end="STOP"

syntax "Java source" "\.java$"
color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"
color red ""[^"]*""
color yellow "<(true|false|null)>"
color blue "//.*"
color blue start="/\*" end="\*/"
color brightblue start="/\*\*" end="\*/"
color brightgreen,brightgreen "[ ]+$"

syntax "nanorc" "[\.]*nanorc$"
color white "^ *(set|unset).*$"
color cyan "^ *(set|unset) (autoindent|backup|const|cut|fill|keypad|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|regexp|smooth|speller|suspend|tabsize|tempfile|historylog|view)"
color brightwhite "^ *syntax [^ ]*"
color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
color white "^ *color\>.*"
color yellow "^ *color (bright)?(white|black|red|blue|green|yellow|magenta|cyan)\>"
color magenta "^ *color\>"
color green "^#.*$"

syntax "bash" "\.sh$"
color brightblack "#.*"
color brightyellow "\(" "\)" "\{" "\}"
color red "\<[A-Z_]{2,}\>"
color red "[\$\*\'\`\|\=]"
color brightblue "\[.*\]"
color green "\<-e\>" "\<-d\>" "\<-f\>" "\<-r\>" "\<-g\>" "\<-u\>" "\<-u\>" "\<-w\>" "\<-x\>" "\<-L\>"
color green "\<-eq\>" "\<-ne\>" "\<-gt\>" "\<-lt\>" "\<-ge\>" "\<-le\>" "\<-s\>" "\<-n\>" "\<-z\>"
color blue "\" "\" "\" "\" "\" "\" "\" "\" "\"
color blue "\" "\" "\" "\" "\"
color brightwhite "\.*"


And thats it. You may want to read the /usr/share/doc/nano/nanorc.sample file for any other options you may want or change the color highlighting a bit.
rate this article:
current rating: average rating: 1.4 (58 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-06-27
7zip - 26.02
Ebuild name:

app-arch/7zip-26.02

Description

Free file archiver for extremely high compression

Added to portage

2026-06-27

ast-serialize - 0.5.0
Ebuild name:

dev-python/ast-serialize-0.5.0

Description

Python bindings for mypy AST serialization

Added to portage

2026-06-27

buildah - 1.44.0-r1
Ebuild name:

app-containers/buildah-1.44.0-r1

Description

A tool that facilitates building OCI images

Added to portage

2026-06-27

c-blosc2 - 3.1.5
Ebuild name:

dev-libs/c-blosc2-3.1.5

Description

Blocking, shuffling and lossless compression library

Added to portage

2026-06-27

closure-compiler-bin - 20260622
Ebuild name:

dev-lang/closure-compiler-bin-20260622

Description

JavaScript optimizing compiler

Added to portage

2026-06-27

container-libs - 0.68.0
Ebuild name:

app-containers/container-libs-0.68.0

Description

Several utilities from the containers project

Added to portage

2026-06-27

docker-buildx - 0.35.0
Ebuild name:

app-containers/docker-buildx-0.35.0

Description

Docker CLI plugin for extended build capabilities with BuildKit

Added to portage

2026-06-27

editline - 2.0.0
Ebuild name:

dev-libs/editline-2.0.0

Description

line editing library for UNIX call compatible with the FSF readline

Added to portage

2026-06-27

edk2 - 202605
Ebuild name:

sys-firmware/edk2-202605

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-06-27

edk2-bin - 202605
Ebuild name:

sys-firmware/edk2-bin-202605

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-06-27

eisl - 5.67
Ebuild name:

dev-lang/eisl-5.67

Description

Interpreter and compiler compatible with the ISLisp standard

Added to portage

2026-06-27

fastapi - 0.138.1
Ebuild name:

dev-python/fastapi-0.138.1

Description

High performance framework, easy to learn, fast to code, ready for produ

Added to portage

2026-06-27

firefox - 152.0.3
Ebuild name:

www-client/firefox-152.0.3

Description

Firefox Web Browser

Added to portage

2026-06-27

firefox-bin - 152.0.3
Ebuild name:

www-client/firefox-bin-152.0.3

Description

Firefox Web Browser

Added to portage

2026-06-27

firefox-l10n - 152.0.3
Ebuild name:

www-client/firefox-l10n-152.0.3

Description

Firefox Web Browser's translation files

Added to portage

2026-06-27

fuzzylite - 6.0
Ebuild name:

dev-libs/fuzzylite-6.0

Description

A fuzzy logic control library in C++

Added to portage

2026-06-27

greenlet - 3.5.3
Ebuild name:

dev-python/greenlet-3.5.3

Description

Lightweight in-process concurrent programming

Added to portage

2026-06-27

httplib2 - 0.32.0
Ebuild name:

dev-python/httplib2-0.32.0

Description

A comprehensive HTTP client library

Added to portage

2026-06-27

httpx2 - 2.5.0
Ebuild name:

dev-python/httpx2-2.5.0

Description

The next generation HTTP client (Pydantic fork)

Added to portage

2026-06-27

ibus-m17n - 1.4.40
Ebuild name:

app-i18n/ibus-m17n-1.4.40

Description

M17N engine for IBus

Added to portage

2026-06-27

ibus-typing-booster - 2.30.10
Ebuild name:

app-i18n/ibus-typing-booster-2.30.10

Description

Completion input method for IBus

Added to portage

2026-06-27

ipython - 9.15.0
Ebuild name:

dev-python/ipython-9.15.0

Description

Advanced interactive shell for Python

Added to portage

2026-06-27

jinxed - 2.0.4
Ebuild name:

dev-python/jinxed-2.0.4

Description

A pure-Python implementation of a subset of the Python curses library

Added to portage

2026-06-27

joserfc - 1.7.1
Ebuild name:

dev-python/joserfc-1.7.1

Description

A Python library for JOSE RFCs JWS, JWE, JWK, JWA, JWT

Added to portage

2026-06-27

libpass - 1.9.3
Ebuild name:

dev-python/libpass-1.9.3

Description

Fork of passlib, a password hashing framework

Added to portage

2026-06-27

libsquish - 1.15.1.4
Ebuild name:

media-libs/libsquish-1.15.1.4

Description

Library for compressing images with the DXT/S3TC standard

Added to portage

2026-06-27

man-pages-ja - 20260615
Ebuild name:

app-i18n/man-pages-ja-20260615

Description

Collection of manual pages translated into Japanese

Added to portage

2026-06-27

mlt - 7.40.0
Ebuild name:

media-libs/mlt-7.40.0

Description

Open source multimedia framework for television broadcasting

Added to portage

2026-06-27

modus-themes - 5.3.0
Ebuild name:

app-emacs/modus-themes-5.3.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-06-27

nerdctl - 2.3.3
Ebuild name:

app-containers/nerdctl-2.3.3

Description

Docker-compatible CLI for containerd, with support for Compose

Added to portage

2026-06-27

nest-asyncio2 - 1.7.2
Ebuild name:

dev-python/nest-asyncio2-1.7.2

Description

Patch asyncio to allow nested event loops

Added to portage

2026-06-27

netavark - 2.0.0
Ebuild name:

app-containers/netavark-2.0.0

Description

A container network stack

Added to portage

2026-06-27

podman - 6.0.0
Ebuild name:

app-containers/podman-6.0.0

Description

A tool for managing OCI containers and pods with Docker-compatible CLI

Added to portage

2026-06-27

podman-tui - 1.11.2
Ebuild name:

app-containers/podman-tui-1.11.2

Description

Terminal UI frontend for Podman

Added to portage

2026-06-27

racket-mode - 1_p20260303
Ebuild name:

app-emacs/racket-mode-1_p20260303

Description

Emacs modes for Racket edit, REPL, check-syntax, debug, profile,

Added to portage

2026-06-27

rclone - 1.74.3
Ebuild name:

net-misc/rclone-1.74.3

Description

A program to sync files to and from various cloud storage providers

Added to portage

2026-06-27

reason - 3.18.0
Ebuild name:

dev-ml/reason-3.18.0

Description

Simple, fast & type safe language that leverages JavaScript and OCaml

Added to portage

2026-06-27

rebulk - 4.1.0
Ebuild name:

dev-python/rebulk-4.1.0

Description

Python library that performs advanced searches in strings

Added to portage

2026-06-27

rsyslog - 8.2606.0
Ebuild name:

app-admin/rsyslog-8.2606.0

Description

An enhanced multi-threaded syslogd with database support and more

Added to portage

2026-06-27

skopeo - 1.23.0-r1
Ebuild name:

app-containers/skopeo-1.23.0-r1

Description

Work with remote container images registries

Added to portage

2026-06-27

sonarr-bin - 4.0.19.2979
Ebuild name:

www-apps/sonarr-bin-4.0.19.2979

Description

Sonarr is a Smart PVR for newsgroup and bittorrent users

Added to portage

2026-06-27

sqlglot - 30.12.0
Ebuild name:

dev-python/sqlglot-30.12.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-06-27

syrupy - 5.3.4
Ebuild name:

dev-python/syrupy-5.3.4

Description

The sweeter pytest snapshot plugin

Added to portage

2026-06-27

tables - 3.11.1-r1
Ebuild name:

dev-python/tables-3.11.1-r1

Description

Hierarchical datasets for Python

Added to portage

2026-06-27

translate-toolkit - 3.19.13
Ebuild name:

dev-python/translate-toolkit-3.19.13

Description

Toolkit to convert between many translation formats

Added to portage

2026-06-27

tree-sitter-racket - 0.24.7_p1
Ebuild name:

dev-libs/tree-sitter-racket-0.24.7_p1

Description

Racket programming language grammar for Tree-sitter

Added to portage

2026-06-27

tree-sitter-unison - 2.1.3
Ebuild name:

dev-libs/tree-sitter-unison-2.1.3

Description

Unison programming language grammar for Tree-sitter

Added to portage

2026-06-27

typer - 0.26.8
Ebuild name:

dev-python/typer-0.26.8

Description

Build great CLIs. Easy to code. Based on Python type hints

Added to portage

2026-06-27

uv - 0.11.25
Ebuild name:

dev-python/uv-0.11.25

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-06-27

vcmi - 1.7.4
Ebuild name:

games-strategy/vcmi-1.7.4

Description

Open-source engine for Heroes of Might and Magic III

Added to portage

2026-06-27

2026-06-26
R - 4.6.1
Ebuild name:

dev-lang/R-4.6.1

Description

Language and environment for statistical computing and graphics

Added to portage

2026-06-26

alembic - 1.18.5
Ebuild name:

dev-python/alembic-1.18.5

Description

Database migrations tool, written by the author of SQLAlchemy

Added to portage

2026-06-26

blis - 2.1
Ebuild name:

sci-libs/blis-2.1

Description

BLAS-like Library Instantiation Software Framework

Added to portage

2026-06-26

cifs-utils - 7.6
Ebuild name:

net-fs/cifs-utils-7.6

Description

Tools for Managing Linux CIFS Client Filesystems

Added to portage

2026-06-26

delve - 1.27.0
Ebuild name:

dev-go/delve-1.27.0

Description

A source-level debugger for the Go programming language

Added to portage

2026-06-26

dxvk - 3.0
Ebuild name:

app-emulation/dxvk-3.0

Description

Vulkan-based implementation of D3D9, D3D10 and D3D11 for Linux / Wine

Added to portage

2026-06-26

glycin-loaders - 2.1.5
Ebuild name:

media-libs/glycin-loaders-2.1.5

Description

Loaders for glycin clients (glycin crate or libglycin)

Added to portage

2026-06-26

google-api-python-client - 2.198.0
Ebuild name:

dev-python/google-api-python-client-2.198.0

Description

Google API Client for Python

Added to portage

2026-06-26

google-auth - 2.55.1
Ebuild name:

dev-python/google-auth-2.55.1

Description

Google Authentication Library

Added to portage

2026-06-26

incus - 7.2
Ebuild name:

app-containers/incus-7.2

Description

Modern, secure and powerful system container and virtual machine manager

Added to portage

2026-06-26

ispc - 1.31.0
Ebuild name:

dev-lang/ispc-1.31.0

Description

Intel SPMD Program Compiler

Added to portage

2026-06-26

libtorrent - 0.16.15
Ebuild name:

net-libs/libtorrent-0.16.15

Description

BitTorrent library written in C++ for *nix

Added to portage

2026-06-26

magit-popup - 2.13.3-r1
Ebuild name:

app-emacs/magit-popup-2.13.3-r1

Description

Define prefix-infix-suffix command combos

Added to portage

2026-06-26

mailcrypt - 3.5.9-r3
Ebuild name:

app-emacs/mailcrypt-3.5.9-r3

Description

Provides a simple interface to public key cryptography with OpenPGP

Added to portage

2026-06-26

mutagen - 1.48.1
Ebuild name:

media-libs/mutagen-1.48.1

Description

Audio metadata tag reader and writer implemented in pure Python

Added to portage

2026-06-26

newsboat - 2.44
Ebuild name:

net-news/newsboat-2.44

Description

An RSS/Atom feed reader for text terminals

Added to portage

2026-06-26

pdns - 5.0.6
Ebuild name:

net-dns/pdns-5.0.6

Description

The PowerDNS Daemon

Added to portage

2026-06-26

pdns - 5.1.2
Ebuild name:

net-dns/pdns-5.1.2

Description

The PowerDNS Daemon

Added to portage

2026-06-26

pdns-recursor - 5.3.8
Ebuild name:

net-dns/pdns-recursor-5.3.8

Description

The PowerDNS Recursor

Added to portage

2026-06-26

pdns-recursor - 5.4.3
Ebuild name:

net-dns/pdns-recursor-5.4.3

Description

The PowerDNS Recursor

Added to portage

2026-06-26

photoqt - 5.4
Ebuild name:

media-gfx/photoqt-5.4

Description

Simple but powerful Qt-based image viewer

Added to portage

2026-06-26

photoqt-extensions - 5.4
Ebuild name:

media-plugins/photoqt-extensions-5.4

Description

Official extensions for PhotoQt

Added to portage

2026-06-26

postfix - 3.12_pre20260624
Ebuild name:

mail-mta/postfix-3.12_pre20260624

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-06-26

pugixml - 1.16
Ebuild name:

dev-libs/pugixml-1.16

Description

Light-weight, simple, and fast XML parser for C++ with XPath support

Added to portage

2026-06-26

pygraphviz - 2.0
Ebuild name:

dev-python/pygraphviz-2.0

Description

Python wrapper for the Graphviz Agraph data structure

Added to portage

2026-06-26

pyproject-fmt - 2.25.1
Ebuild name:

dev-python/pyproject-fmt-2.25.1

Description

Format your pyproject.toml file

Added to portage

2026-06-26

rtorrent - 0.16.15
Ebuild name:

net-p2p/rtorrent-0.16.15

Description

BitTorrent Client using libtorrent

Added to portage

2026-06-26

rutorrent - 5.3.3
Ebuild name:

www-apps/rutorrent-5.3.3

Description

ruTorrent is a front-end for the popular Bittorrent client rTorrent

Added to portage

2026-06-26

samba - 4.23.9
Ebuild name:

net-fs/samba-4.23.9

Description

Samba Suite Version 4

Added to portage

2026-06-26

setuptools-scm - 10.2.0
Ebuild name:

dev-python/setuptools-scm-10.2.0

Description

Manage versions by scm tags via setuptools

Added to portage

2026-06-26

sphinx-autodoc-typehints - 3.12.0
Ebuild name:

dev-python/sphinx-autodoc-typehints-3.12.0

Description

Type hints support for the Sphinx autodoc extension

Added to portage

2026-06-26

sslscan - 2.2.2
Ebuild name:

net-analyzer/sslscan-2.2.2

Description

Fast SSL configuration scanner

Added to portage

2026-06-26

tox - 4.56.1
Ebuild name:

dev-python/tox-4.56.1

Description

virtualenv-based automation of test activities

Added to portage

2026-06-26

uhd - 4.10.0.0-r1
Ebuild name:

net-wireless/uhd-4.10.0.0-r1

Description

Universal Software Radio Peripheral (USRP) Hardware Driver

Added to portage

2026-06-26

urwid - 4.0.3
Ebuild name:

dev-python/urwid-4.0.3

Description

Curses-based user interface library for Python

Added to portage

2026-06-26

vcs-versioning - 2.2.0
Ebuild name:

dev-python/vcs-versioning-2.2.0

Description

Core VCS versioning functionality from setuptools-scm

Added to portage

2026-06-26

vlc - 4.0.0_pre20260625
Ebuild name:

media-video/vlc-4.0.0_pre20260625

Description

Media player and framework with support for most multimedia files

Added to portage

2026-06-26

wand - 0.7.2
Ebuild name:

dev-python/wand-0.7.2

Description

Ctypes-based simple ImageMagick binding for Python

Added to portage

2026-06-26

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 62.4 ms