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:

87058

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-07-21
container-libs - 0.68.0-r1
Ebuild name:

app-containers/container-libs-0.68.0-r1

Description

Several utilities from the containers project

Added to portage

2026-07-21

containers-shortnames - 2025.03.19_p20260615
Ebuild name:

app-containers/containers-shortnames-2025.03.19_p20260615

Description

Configures default shortnames (aliases) f

Added to portage

2026-07-21

dkms - 3.4.2
Ebuild name:

sys-kernel/dkms-3.4.2

Description

Dynamic Kernel Module Support

Added to portage

2026-07-21

dracut - 111-r2
Ebuild name:

sys-kernel/dracut-111-r2

Description

Generic initramfs generation tool

Added to portage

2026-07-21

firefox - 153.0
Ebuild name:

www-client/firefox-153.0

Description

Firefox Web Browser

Added to portage

2026-07-21

firefox-l10n - 153.0
Ebuild name:

www-client/firefox-l10n-153.0

Description

Firefox Web Browser's translation files

Added to portage

2026-07-21

fuse-overlayfs - 1.17
Ebuild name:

sys-fs/fuse-overlayfs-1.17

Description

FUSE implementation for overlayfs

Added to portage

2026-07-21

ggml - 0.17.0
Ebuild name:

sci-ml/ggml-0.17.0

Description

Tensor library for machine learning

Added to portage

2026-07-21

ophcrack - 3.8.0-r2
Ebuild name:

app-crypt/ophcrack-3.8.0-r2

Description

A time-memory-trade-off-cracker

Added to portage

2026-07-21

ophcrack-tables - 1.0-r2
Ebuild name:

app-crypt/ophcrack-tables-1.0-r2

Description

Tables available for ophcrack

Added to portage

2026-07-21

osslsigncode - 2.13
Ebuild name:

app-crypt/osslsigncode-2.13

Description

Platform-independent tool for Authenticode signing of EXE/CAB files

Added to portage

2026-07-21

osslsigncode - 2.9
Ebuild name:

app-crypt/osslsigncode-2.9

Description

Platform-independent tool for Authenticode signing of EXE/CAB files

Added to portage

2026-07-21

p11-kit - 0.26.2
Ebuild name:

app-crypt/p11-kit-0.26.2

Description

Provides a standard configuration setup for installing PKCS11

Added to portage

2026-07-21

p11-kit - 0.26.4
Ebuild name:

app-crypt/p11-kit-0.26.4

Description

Provides a standard configuration setup for installing PKCS11

Added to portage

2026-07-21

paperkey - 1.6
Ebuild name:

app-crypt/paperkey-1.6

Description

OpenPGP key archiver

Added to portage

2026-07-21

passt - 2026.07.16
Ebuild name:

net-misc/passt-2026.07.16

Description

User-mode networking daemons for VMs and namespaces, replacement for Slir

Added to portage

2026-07-21

podman - 5.8.5
Ebuild name:

app-containers/podman-5.8.5

Description

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

Added to portage

2026-07-21

podman - 6.0.1
Ebuild name:

app-containers/podman-6.0.1

Description

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

Added to portage

2026-07-21

podman-tui - 1.11.3
Ebuild name:

app-containers/podman-tui-1.11.3

Description

Terminal UI frontend for Podman

Added to portage

2026-07-21

prometheus-podman-exporter - 1.21.2
Ebuild name:

app-metrics/prometheus-podman-exporter-1.21.2

Description

Exporter for podman giving containers, pods, images,

Added to portage

2026-07-21

pyqtgraph - 0.14.0-r1
Ebuild name:

dev-python/pyqtgraph-0.14.0-r1

Description

A pure-python graphics and GUI library built on PyQt and numpy

Added to portage

2026-07-21

2026-07-20
acme-sh - 3.1.4
Ebuild name:

app-crypt/acme-sh-3.1.4

Description

A pure Unix shell script implementing ACME client protocol

Added to portage

2026-07-20

aws-c-auth - 0.10.4
Ebuild name:

dev-libs/aws-c-auth-0.10.4

Description

AWS C Auth C99 library implementation of AWS client-side authentication

Added to portage

2026-07-20

aws-c-cal - 0.9.14
Ebuild name:

dev-libs/aws-c-cal-0.9.14

Description

Crypto Abstraction Layer Cross-Platform C99 wrapper for cryptography prim

Added to portage

2026-07-20

aws-c-common - 0.14.2
Ebuild name:

dev-libs/aws-c-common-0.14.2

Description

Core c99 package for AWS SDK for C

Added to portage

2026-07-20

aws-c-compression - 0.3.2
Ebuild name:

dev-libs/aws-c-compression-0.3.2

Description

AWS C Compression cross-platform algorithms

Added to portage

2026-07-20

aws-c-event-stream - 0.7.1
Ebuild name:

dev-libs/aws-c-event-stream-0.7.1

Description

Core c99 package for AWS SDK for C

Added to portage

2026-07-20

aws-c-http - 0.11.0
Ebuild name:

dev-libs/aws-c-http-0.11.0

Description

AWS C Http C99 implementation of the HTTP/1.1 and HTTP/2 specifications

Added to portage

2026-07-20

aws-c-io - 0.27.4
Ebuild name:

dev-libs/aws-c-io-0.27.4

Description

AWS C IO It handles all IO and TLS work for application protocols

Added to portage

2026-07-20

aws-c-mqtt - 0.16.0
Ebuild name:

dev-libs/aws-c-mqtt-0.16.0

Description

AWS C MQTT C99 implementation

Added to portage

2026-07-20

aws-c-s3 - 0.13.1
Ebuild name:

dev-libs/aws-c-s3-0.13.1

Description

AWS C S3 async library

Added to portage

2026-07-20

aws-c-sdkutils - 0.2.7
Ebuild name:

dev-libs/aws-c-sdkutils-0.2.7

Description

AWS C SDKUTILS C99 library implementing AWS SDK specific utilities

Added to portage

2026-07-20

aws-checksums - 0.2.10
Ebuild name:

dev-libs/aws-checksums-0.2.10

Description

Cross-Platform HW accelerated CRC32c and CRC32 with fallback to SW

Added to portage

2026-07-20

aws-crt-cpp - 0.37.4
Ebuild name:

dev-cpp/aws-crt-cpp-0.37.4

Description

C++ wrapper around the aws-c-* libraries

Added to portage

2026-07-20

aws-sdk-cpp - 1.11.764
Ebuild name:

dev-cpp/aws-sdk-cpp-1.11.764

Description

AWS SDK for C++

Added to portage

2026-07-20

below - 9999
Ebuild name:

sys-process/below-9999

Description

An interactive tool to view and record historical system data

Added to portage

2026-07-20

bitarray - 3.9.1
Ebuild name:

dev-python/bitarray-3.9.1

Description

Efficient arrays of booleans -- C extension

Added to portage

2026-07-20

confuse - 2.2.1
Ebuild name:

dev-python/confuse-2.2.1

Description

Confuse is a configuration library for Python that uses YAML

Added to portage

2026-07-20

dulwich - 1.2.12
Ebuild name:

dev-python/dulwich-1.2.12

Description

Pure-Python implementation of the Git file formats and protocols

Added to portage

2026-07-20

faust-cchardet - 2.2.1
Ebuild name:

dev-python/faust-cchardet-2.2.1

Description

High speed universal character encoding detector

Added to portage

2026-07-20

firefox-bin - 153.0
Ebuild name:

www-client/firefox-bin-153.0

Description

Firefox Web Browser

Added to portage

2026-07-20

fractal - 14.1
Ebuild name:

net-im/fractal-14.1

Description

Matrix messaging app for GNOME written in Rust

Added to portage

2026-07-20

gcc - 17.0.0_p20260719
Ebuild name:

sys-devel/gcc-17.0.0_p20260719

Description

The GNU Compiler Collection

Added to portage

2026-07-20

gherkin-official - 42.0.0
Ebuild name:

dev-python/gherkin-official-42.0.0

Description

Gherkin parser/compiler for Python

Added to portage

2026-07-20

git-sources - 7.2_rc4
Ebuild name:

sys-kernel/git-sources-7.2_rc4

Description

The very latest -git version of the Linux kernel

Added to portage

2026-07-20

gpredict - 2.5.2
Ebuild name:

media-radio/gpredict-2.5.2

Description

Real-time satellite tracking and orbit prediction application

Added to portage

2026-07-20

gulrak-filesystem - 1.5.16
Ebuild name:

dev-cpp/gulrak-filesystem-1.5.16

Description

Header-only single-file std compatible helper library

Added to portage

2026-07-20

helvum - 0.6.2
Ebuild name:

media-sound/helvum-0.6.2

Description

A GTK patchbay for pipewire

Added to portage

2026-07-20

htop - 3.5.2
Ebuild name:

sys-process/htop-3.5.2

Description

Interactive process viewer

Added to portage

2026-07-20

hypothesis - 6.157.0
Ebuild name:

dev-python/hypothesis-6.157.0

Description

A library for property based testing

Added to portage

2026-07-20

joserfc - 1.7.4
Ebuild name:

dev-python/joserfc-1.7.4

Description

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

Added to portage

2026-07-20

jupyter-builder - 1.1.1-r1
Ebuild name:

dev-python/jupyter-builder-1.1.1-r1

Description

JupyterLab build tools

Added to portage

2026-07-20

kddockwidgets - 2.4.1
Ebuild name:

gui-libs/kddockwidgets-2.4.1

Description

KDAB's Dock Widget Framework for Qt

Added to portage

2026-07-20

libxmp - 4.7.1
Ebuild name:

media-libs/libxmp-4.7.1

Description

Library that renders module files to PCM data

Added to portage

2026-07-20

lowdown - 3.1.1
Ebuild name:

app-text/lowdown-3.1.1

Description

Markdown translator producing HTML5, roff documents in the ms and man format

Added to portage

2026-07-20

mpd - 0.24.12-r1
Ebuild name:

media-sound/mpd-0.24.12-r1

Description

The Music Player Daemon (mpd)

Added to portage

2026-07-20

onak - 0.6.4
Ebuild name:

app-crypt/onak-0.6.4

Description

onak is an OpenPGP keyserver

Added to portage

2026-07-20

openrdap - 0.10.1
Ebuild name:

net-misc/openrdap-0.10.1

Description

RDAP command line client

Added to portage

2026-07-20

pebble - 5.2.1
Ebuild name:

dev-python/pebble-5.2.1

Description

Threading and multiprocessing eye-candy

Added to portage

2026-07-20

postfix - 3.12_pre20260716
Ebuild name:

mail-mta/postfix-3.12_pre20260716

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-07-20

pyshp - 3.1.4
Ebuild name:

sci-libs/pyshp-3.1.4

Description

Pure Python read/write support for ESRI Shapefile format

Added to portage

2026-07-20

ruff - 0.15.22
Ebuild name:

dev-util/ruff-0.15.22

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-07-20

sdl2-mixer - 2.8.1-r4
Ebuild name:

media-libs/sdl2-mixer-2.8.1-r4

Description

Simple Direct Media Layer Mixer Library

Added to portage

2026-07-20

sdl2-mixer - 2.8.2-r1
Ebuild name:

media-libs/sdl2-mixer-2.8.2-r1

Description

Simple Direct Media Layer Mixer Library

Added to portage

2026-07-20

soupsieve - 2.9
Ebuild name:

dev-python/soupsieve-2.9

Description

A modern CSS selector implementation for BeautifulSoup

Added to portage

2026-07-20

stb - 20260415-r1
Ebuild name:

dev-libs/stb-20260415-r1

Description

Single-file C/C++ libraries for various purposes

Added to portage

2026-07-20

term-ansicolor - 1.11.3-r1
Ebuild name:

dev-ruby/term-ansicolor-1.11.3-r1

Description

Small Ruby library that colors strings using ANSI escape sequence

Added to portage

2026-07-20

winbox - 4.3
Ebuild name:

app-admin/winbox-4.3

Description

Management Software for MikroTik RouterOS

Added to portage

2026-07-20

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