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:

89293

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-10-18
libzip - 1.12.1
Ebuild name:

dev-libs/libzip-1.12.1

Description

Library for manipulating zip archives

Added to portage

2026-10-18

rocm-core - 10.1.0
Ebuild name:

dev-libs/rocm-core-10.1.0

Description

Library that provides ROCm release version and install path information

Added to portage

2026-10-18

rocm-device-libs - 10.1.0
Ebuild name:

dev-libs/rocm-device-libs-10.1.0

Description

Radeon Open Compute Device Libraries

Added to portage

2026-10-18

roct-thunk-interface - 10.1.0
Ebuild name:

dev-libs/roct-thunk-interface-10.1.0

Description

Radeon Open Compute Thunk Interface

Added to portage

2026-10-18

sddm - 0.21.0_p20260819-r1
Ebuild name:

x11-misc/sddm-0.21.0_p20260819-r1

Description

Simple Desktop Display Manager

Added to portage

2026-10-18

2026-10-17
aioquic - 1.7.0
Ebuild name:

dev-python/aioquic-1.7.0

Description

An implementation of QUIC and HTTP/3

Added to portage

2026-10-17

alephone-durandal - 20260930-r1
Ebuild name:

games-fps/alephone-durandal-20260930-r1

Description

Aleph One - Marathon 2 (Durandal)

Added to portage

2026-10-17

alephone-infinity - 20260930-r1
Ebuild name:

games-fps/alephone-infinity-20260930-r1

Description

Aleph One - Marathon Infinity

Added to portage

2026-10-17

alephone-marathon - 20260930-r1
Ebuild name:

games-fps/alephone-marathon-20260930-r1

Description

Aleph One - Marathon (M1A1)

Added to portage

2026-10-17

ast-serialize - 0.13.1
Ebuild name:

dev-python/ast-serialize-0.13.1

Description

Python bindings for mypy AST serialization

Added to portage

2026-10-17

aws-crt-cpp - 0.44.0
Ebuild name:

dev-cpp/aws-crt-cpp-0.44.0

Description

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

Added to portage

2026-10-17

awscrt - 0.38.0
Ebuild name:

dev-python/awscrt-0.38.0

Description

A common runtime for AWS Python projects

Added to portage

2026-10-17

berkeleydb - 18.1.16
Ebuild name:

dev-python/berkeleydb-18.1.16

Description

Python bindings for Oracle Berkeley DB

Added to portage

2026-10-17

btrfs-assistant - 3.0.0
Ebuild name:

app-admin/btrfs-assistant-3.0.0

Description

GUI management tool to make managing a Btrfs filesystem easier

Added to portage

2026-10-17

claude-code - 2.1.301
Ebuild name:

dev-util/claude-code-2.1.301

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-10-17

cli-helpers - 2.15.2
Ebuild name:

dev-python/cli-helpers-2.15.2

Description

Python helpers for common CLI tasks

Added to portage

2026-10-17

cnijfilter2 - 6.90
Ebuild name:

net-print/cnijfilter2-6.90

Description

IJ Printer Driver

Added to portage

2026-10-17

createrepo_c - 1.2.5
Ebuild name:

app-arch/createrepo_c-1.2.5

Description

C implementation of createrepo

Added to portage

2026-10-17

darktable - 5.6.2
Ebuild name:

media-gfx/darktable-5.6.2

Description

A virtual lighttable and darkroom for photographers

Added to portage

2026-10-17

distlib - 0.4.4
Ebuild name:

dev-python/distlib-0.4.4

Description

Low-level components of distutils2/packaging

Added to portage

2026-10-17

django-otp - 1.7.5
Ebuild name:

dev-python/django-otp-1.7.5

Description

Django framework adding two-factor authentication using one-time passwo

Added to portage

2026-10-17

elasticsearch - 9.5.5
Ebuild name:

app-misc/elasticsearch-9.5.5

Description

Free and Open, Distributed, RESTful Search Engine

Added to portage

2026-10-17

fastapi - 0.143.3
Ebuild name:

dev-python/fastapi-0.143.3

Description

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

Added to portage

2026-10-17

ggml - 0.27.0
Ebuild name:

sci-ml/ggml-0.27.0

Description

Tensor library for machine learning

Added to portage

2026-10-17

graphviz-dot-mode - 0.4_p20181118
Ebuild name:

app-emacs/graphviz-dot-mode-0.4_p20181118

Description

Emacs mode for editing and previewing Graphviz dot graphs

Added to portage

2026-10-17

graphviz-dot-mode - 0.5.0
Ebuild name:

app-emacs/graphviz-dot-mode-0.5.0

Description

Emacs mode for editing and previewing Graphviz dot graphs

Added to portage

2026-10-17

groovy-emacs-modes - 2.1
Ebuild name:

app-emacs/groovy-emacs-modes-2.1

Description

Groovy major mode, grails minor mode, and a groovy inferior mode

Added to portage

2026-10-17

hypothesis - 6.170.1
Ebuild name:

dev-python/hypothesis-6.170.1

Description

A library for property based testing

Added to portage

2026-10-17

incus - 7.0.2
Ebuild name:

app-containers/incus-7.0.2

Description

Modern, secure and powerful system container and virtual machine manager

Added to portage

2026-10-17

jellyfin-bin - 12.2-r1
Ebuild name:

www-apps/jellyfin-bin-12.2-r1

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2026-10-17

jsonpath-ng - 1.11.0
Ebuild name:

dev-python/jsonpath-ng-1.11.0

Description

Python JSONPath Next-Generation

Added to portage

2026-10-17

kde-cli-tools - 6.8.0-r1
Ebuild name:

kde-plasma/kde-cli-tools-6.8.0-r1

Description

Tools based on KDE Frameworks 6 to better interact with the syste

Added to portage

2026-10-17

libmodulemd - 2.15.3
Ebuild name:

sys-libs/libmodulemd-2.15.3

Description

C Library for manipulating Fedora Modularity metadata files

Added to portage

2026-10-17

mkl - 2026.2.0.881
Ebuild name:

sci-libs/mkl-2026.2.0.881

Description

Intel Math Kernel Library

Added to portage

2026-10-17

mu - 1.14.4-r1
Ebuild name:

net-mail/mu-1.14.4-r1

Description

Set of tools to deal with Maildirs, in particular, searching and indexing

Added to portage

2026-10-17

mumps - 5.8.2
Ebuild name:

sci-libs/mumps-5.8.2

Description

MUltifrontal Massively Parallel sparse direct matrix Solver

Added to portage

2026-10-17

ncspot - 1.5.0
Ebuild name:

media-sound/ncspot-1.5.0

Description

ncurses Spotify client written in Rust using librespot

Added to portage

2026-10-17

nrpe - 4.1.3
Ebuild name:

net-analyzer/nrpe-4.1.3

Description

Nagios Remote Plugin Executor

Added to portage

2026-10-17

objgraph - 3.7.0
Ebuild name:

dev-python/objgraph-3.7.0

Description

Draws Python object reference graphs with graphviz

Added to portage

2026-10-17

ollama - 0.40.5
Ebuild name:

sci-ml/ollama-0.40.5

Description

Get up and running with Llama 3, Mistral, Gemma, and other language models

Added to portage

2026-10-17

openntpd - 7.9_p1-r1
Ebuild name:

net-misc/openntpd-7.9_p1-r1

Description

Lightweight NTP server ported from OpenBSD

Added to portage

2026-10-17

pecl-memcached - 3.4.0-r1
Ebuild name:

dev-php/pecl-memcached-3.4.0-r1

Description

Interface PHP with memcached via libmemcached library

Added to portage

2026-10-17

pillow - 13.0.0
Ebuild name:

dev-python/pillow-13.0.0

Description

Python Imaging Library (fork)

Added to portage

2026-10-17

pkgcore - 0.12.47
Ebuild name:

sys-apps/pkgcore-0.12.47

Description

a framework for package management

Added to portage

2026-10-17

pkginfo - 1.13.3
Ebuild name:

dev-python/pkginfo-1.13.3

Description

Provides an API for querying the distutils metadata written in a PKG-INFO

Added to portage

2026-10-17

platformio - 6.2.0-r1
Ebuild name:

dev-embedded/platformio-6.2.0-r1

Description

An open source ecosystem for IoT development

Added to portage

2026-10-17

portalocker - 4.4.1
Ebuild name:

dev-python/portalocker-4.4.1

Description

A library for Python file locking

Added to portage

2026-10-17

pyqt-builder - 1.20.1
Ebuild name:

dev-python/pyqt-builder-1.20.1

Description

The PEP 517 compliant PyQt build system

Added to portage

2026-10-17

rocm-cmake - 10.1.0
Ebuild name:

dev-build/rocm-cmake-10.1.0

Description

Radeon Open Compute CMake Modules

Added to portage

2026-10-17

s2n-tls - 1.7.12
Ebuild name:

dev-libs/s2n-tls-1.7.12

Description

s2n-tls is a C99 implementation of the TLS/SSL protocols

Added to portage

2026-10-17

sdl3-image - 3.4.8
Ebuild name:

media-libs/sdl3-image-3.4.8

Description

A simple library to load images of various formats as SDL surfaces

Added to portage

2026-10-17

sphinx-autodoc-typehints - 3.17.1
Ebuild name:

dev-python/sphinx-autodoc-typehints-3.17.1

Description

Type hints support for the Sphinx autodoc extension

Added to portage

2026-10-17

spidermonkey - 140.17.0
Ebuild name:

dev-lang/spidermonkey-140.17.0

Description

Mozilla's JavaScript engine written in C and C++

Added to portage

2026-10-17

spidermonkey - 153.5.0
Ebuild name:

dev-lang/spidermonkey-153.5.0

Description

Mozilla's JavaScript engine written in C and C++

Added to portage

2026-10-17

sqlalchemy - 2.0.55
Ebuild name:

dev-python/sqlalchemy-2.0.55

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-10-17

sqlalchemy - 2.1.5
Ebuild name:

dev-python/sqlalchemy-2.1.5

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-10-17

ssh-audit - 3.9.0_p20261011
Ebuild name:

net-analyzer/ssh-audit-3.9.0_p20261011

Description

SSH server auditing (banner, key exchange, encryption, mac,

Added to portage

2026-10-17

superqt - 0.9.0
Ebuild name:

dev-python/superqt-0.9.0

Description

Missing widgets and components for PyQt/PySide

Added to portage

2026-10-17

union - 6.8.0-r1
Ebuild name:

kde-plasma/union-6.8.0-r1

Description

Style engine providing a unified style description to separate output sty

Added to portage

2026-10-17

wine-vanilla - 11.20
Ebuild name:

app-emulation/wine-vanilla-11.20

Description

Free implementation of Windows(tm) on Unix, without external patch

Added to portage

2026-10-17

zchunk - 1.5.4
Ebuild name:

app-arch/zchunk-1.5.4

Description

File format designed for highly efficient deltas with good compression

Added to portage

2026-10-17

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