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:

88227

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-09-08
bzip3 - 1.5.4
Ebuild name:

app-arch/bzip3-1.5.4

Description

A better and stronger spiritual successor to BZip2

Added to portage

2026-09-08

ccache - 4.14
Ebuild name:

dev-util/ccache-4.14

Description

Fast compiler cache

Added to portage

2026-09-08

curl - 8.22.0
Ebuild name:

net-misc/curl-8.22.0

Description

A Client that groks URLs

Added to portage

2026-09-08

dist-kernel - 6.12.109
Ebuild name:

virtual/dist-kernel-6.12.109

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-08

dist-kernel - 6.18.50
Ebuild name:

virtual/dist-kernel-6.18.50

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-08

dist-kernel - 7.2.4
Ebuild name:

virtual/dist-kernel-7.2.4

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-08

gallery-dl - 1.32.11
Ebuild name:

net-misc/gallery-dl-1.32.11

Description

Download image galleries and collections from several image hosting sit

Added to portage

2026-09-08

gentoo-kernel - 6.12.109
Ebuild name:

sys-kernel/gentoo-kernel-6.12.109

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel - 6.18.50
Ebuild name:

sys-kernel/gentoo-kernel-6.18.50

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel - 7.2.4
Ebuild name:

sys-kernel/gentoo-kernel-7.2.4

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-bin - 6.12.109
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.109

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-bin - 6.18.50
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.50

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-bin - 7.2.4
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.2.4

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-modprep - 6.12.109
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.12.109

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-09-08

gentoo-kernel-modprep - 6.18.50
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.50

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-09-08

gentoo-kernel-modprep - 7.2.4
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.2.4

Description

Minimal subset of gentoo-kernel-bin for building modules, fo

Added to portage

2026-09-08

hiredis - 1.1.1
Ebuild name:

dev-libs/hiredis-1.1.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

hiredis - 1.2.1
Ebuild name:

dev-libs/hiredis-1.2.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

hiredis - 1.3.1
Ebuild name:

dev-libs/hiredis-1.3.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

hiredis - 1.4.1
Ebuild name:

dev-libs/hiredis-1.4.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

keymap-popup - 0.3.0
Ebuild name:

app-emacs/keymap-popup-0.3.0

Description

Described keymaps with popup help

Added to portage

2026-09-08

keywiz - 1.4
Ebuild name:

app-emacs/keywiz-1.4

Description

Emacs key sequence quiz

Added to portage

2026-09-08

kind-icon - 0.2.2
Ebuild name:

app-emacs/kind-icon-0.2.2

Description

Completion kind icons

Added to portage

2026-09-08

redis - 8.10.1
Ebuild name:

dev-db/redis-8.10.1

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.2.9
Ebuild name:

dev-db/redis-8.2.9

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.4.6
Ebuild name:

dev-db/redis-8.4.6

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.6.6
Ebuild name:

dev-db/redis-8.6.6

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.8.2
Ebuild name:

dev-db/redis-8.8.2

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

rg - 2.4.1
Ebuild name:

app-emacs/rg-2.4.1

Description

GNU Emacs search tool based on ripgrep

Added to portage

2026-09-08

vanilla-kernel - 6.12.109
Ebuild name:

sys-kernel/vanilla-kernel-6.12.109

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-08

vanilla-kernel - 6.18.50
Ebuild name:

sys-kernel/vanilla-kernel-6.18.50

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-08

vanilla-kernel - 7.2.4
Ebuild name:

sys-kernel/vanilla-kernel-7.2.4

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-08

2026-09-07
Finance-Quote - 1.710.0
Ebuild name:

dev-perl/Finance-Quote-1.710.0

Description

Get stock and mutual fund quotes from various exchanges

Added to portage

2026-09-07

blisp - 0.0.5-r1
Ebuild name:

sys-firmware/blisp-0.0.5-r1

Description

Bouffalo Labs in-system-programming tool and library

Added to portage

2026-09-07

boltons - 26.2.0
Ebuild name:

dev-python/boltons-26.2.0

Description

Pure-python utilities in the same spirit as the standard library

Added to portage

2026-09-07

cattrs - 26.2.0
Ebuild name:

dev-python/cattrs-26.2.0

Description

Composable complex class support for attrs and dataclasses

Added to portage

2026-09-07

configargparse - 1.7.7
Ebuild name:

dev-python/configargparse-1.7.7

Description

Drop-in replacement for argparse supporting config files and env va

Added to portage

2026-09-07

django-otp - 1.7.3
Ebuild name:

dev-python/django-otp-1.7.3

Description

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

Added to portage

2026-09-07

doctest - 2.5.3
Ebuild name:

dev-cpp/doctest-2.5.3

Description

The fastest feature-rich C++11/14/17/20 single-header testing framework

Added to portage

2026-09-07

ezgb - 0.2.0
Ebuild name:

dev-python/ezgb-0.2.0

Description

A standalone Python library for working with git-bug repositories

Added to portage

2026-09-07

gcc - 13.4.1_p20260902
Ebuild name:

sys-devel/gcc-13.4.1_p20260902

Description

The GNU Compiler Collection

Added to portage

2026-09-07

gcc - 13.4.1_p20260904
Ebuild name:

sys-devel/gcc-13.4.1_p20260904

Description

The GNU Compiler Collection

Added to portage

2026-09-07

gcc - 14.4.1_p20260903
Ebuild name:

sys-devel/gcc-14.4.1_p20260903

Description

The GNU Compiler Collection

Added to portage

2026-09-07

gcc - 15.3.1_p20260904
Ebuild name:

sys-devel/gcc-15.3.1_p20260904

Description

The GNU Compiler Collection

Added to portage

2026-09-07

gcc - 16.2.1_p20260905
Ebuild name:

sys-devel/gcc-16.2.1_p20260905

Description

The GNU Compiler Collection

Added to portage

2026-09-07

gcc - 17.0.0_p20260906
Ebuild name:

sys-devel/gcc-17.0.0_p20260906

Description

The GNU Compiler Collection

Added to portage

2026-09-07

gentoo-sources - 6.12.109
Ebuild name:

sys-kernel/gentoo-sources-6.12.109

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-09-07

gentoo-sources - 6.18.50
Ebuild name:

sys-kernel/gentoo-sources-6.18.50

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-09-07

gentoo-sources - 7.2.4
Ebuild name:

sys-kernel/gentoo-sources-7.2.4

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-09-07

git-sources - 7.3_rc2
Ebuild name:

sys-kernel/git-sources-7.3_rc2

Description

The very latest -git version of the Linux kernel

Added to portage

2026-09-07

hdf5 - 2.2.0
Ebuild name:

sci-libs/hdf5-2.2.0

Description

General purpose library and file format for storing scientific data

Added to portage

2026-09-07

intel-compute-runtime - 26.27.39122.12-r1
Ebuild name:

dev-libs/intel-compute-runtime-26.27.39122.12-r1

Description

Intel Graphics Compute Runtime for oneAPI Level Ze

Added to portage

2026-09-07

ipmiview - 2.25.0.260812
Ebuild name:

net-misc/ipmiview-2.25.0.260812

Description

A GUI application that allows to manage multiple target systems thr

Added to portage

2026-09-07

libpcre2 - 10.48
Ebuild name:

dev-libs/libpcre2-10.48

Description

Perl-compatible regular expression library

Added to portage

2026-09-07

libpcre2-internals - 10.47
Ebuild name:

virtual/libpcre2-internals-10.47

Description

Virtual for dev-libs/libpcre2 internals

Added to portage

2026-09-07

libpcre2-internals - 10.48
Ebuild name:

virtual/libpcre2-internals-10.48

Description

Virtual for dev-libs/libpcre2 internals

Added to portage

2026-09-07

libselinux - 3.10-r3
Ebuild name:

sys-libs/libselinux-3.10-r3

Description

SELinux userland library

Added to portage

2026-09-07

libselinux - 3.11-r1
Ebuild name:

sys-libs/libselinux-3.11-r1

Description

SELinux userland library

Added to portage

2026-09-07

numpy - 2.5.3
Ebuild name:

dev-python/numpy-2.5.3

Description

Fast array and numerical python library

Added to portage

2026-09-07

openapi-core - 0.23.1-r2
Ebuild name:

dev-python/openapi-core-0.23.1-r2

Description

Client-side and server-side support for the OpenAPI Specification

Added to portage

2026-09-07

types-psutil - 7.2.2.20260906
Ebuild name:

dev-python/types-psutil-7.2.2.20260906

Description

Typing stubs for psutil

Added to portage

2026-09-07

vanilla-sources - 6.12.109
Ebuild name:

sys-kernel/vanilla-sources-6.12.109

Description

Full sources for the Linux kernel

Added to portage

2026-09-07

vanilla-sources - 6.18.50
Ebuild name:

sys-kernel/vanilla-sources-6.18.50

Description

Full sources for the Linux kernel

Added to portage

2026-09-07

vanilla-sources - 7.2.4
Ebuild name:

sys-kernel/vanilla-sources-7.2.4

Description

Full sources for the Linux kernel

Added to portage

2026-09-07

wget - 1.25.0-r3
Ebuild name:

net-misc/wget-1.25.0-r3

Description

Network utility to retrieve files from the WWW

Added to portage

2026-09-07

yaspin - 3.5.0
Ebuild name:

dev-python/yaspin-3.5.0

Description

Yet Another Terminal Spinner

Added to portage

2026-09-07

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