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:

83426

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.5 (34 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-02-24
2026-02-23
astroid - 4.1.1
Ebuild name:

dev-python/astroid-4.1.1

Description

Abstract Syntax Tree for logilab packages

Added to portage

2026-02-23

b2sdk - 2.10.3
Ebuild name:

dev-python/b2sdk-2.10.3

Description

Library to access Backblaze B2 cloud storage

Added to portage

2026-02-23

bitwarden-desktop-bin - 2026.1.0
Ebuild name:

app-admin/bitwarden-desktop-bin-2026.1.0

Description

Bitwarden password manager desktop client

Added to portage

2026-02-23

caffe2 - 2.10.0-r3
Ebuild name:

sci-ml/caffe2-2.10.0-r3

Description

A deep learning framework

Added to portage

2026-02-23

calamares - 3.3.14-r7
Ebuild name:

app-admin/calamares-3.3.14-r7

Description

Distribution-independent installer framework

Added to portage

2026-02-23

calamares-gentoo-livecd - 3.3.14_p20260210
Ebuild name:

app-misc/calamares-gentoo-livecd-3.3.14_p20260210

Description

Gentoo Linux Calamares installer configuration fo

Added to portage

2026-02-23

camlp4 - 5.4_p1
Ebuild name:

dev-ml/camlp4-5.4_p1

Description

System for writing extensible parsers for programming languages

Added to portage

2026-02-23

chardet - 6.0.0_p1
Ebuild name:

dev-python/chardet-6.0.0_p1

Description

Universal encoding detector

Added to portage

2026-02-23

chkrootkit - 0.59
Ebuild name:

app-forensics/chkrootkit-0.59

Description

Tool to locally check for signs of a rootkit

Added to portage

2026-02-23

cups - 2.4.16
Ebuild name:

net-print/cups-2.4.16

Description

The Common Unix Printing System

Added to portage

2026-02-23

cups-filters - 2.0.1-r1
Ebuild name:

net-print/cups-filters-2.0.1-r1

Description

Cups filters

Added to portage

2026-02-23

cups-pdf - 3.0.2
Ebuild name:

net-print/cups-pdf-3.0.2

Description

Provides a virtual printer for CUPS to produce PDF files

Added to portage

2026-02-23

curl - 8.19.0_rc2
Ebuild name:

net-misc/curl-8.19.0_rc2

Description

A Client that groks URLs

Added to portage

2026-02-23

diffoscope - 313
Ebuild name:

dev-util/diffoscope-313

Description

Will try to get to the bottom of what makes files or directories different

Added to portage

2026-02-23

feh - 3.11.3
Ebuild name:

media-gfx/feh-3.11.3

Description

A fast, lightweight imageviewer using imlib2

Added to portage

2026-02-23

filezilla - 3.69.6
Ebuild name:

net-ftp/filezilla-3.69.6

Description

FTP client with lots of useful features and an intuitive interface

Added to portage

2026-02-23

firefox-bin - 148.0
Ebuild name:

www-client/firefox-bin-148.0

Description

Firefox Web Browser

Added to portage

2026-02-23

galaxis - 1.13
Ebuild name:

games-puzzle/galaxis-1.13

Description

Curses-based clone of the nifty little Macintosh freeware game Galaxis

Added to portage

2026-02-23

gcc - 16.0.1_p20260222
Ebuild name:

sys-devel/gcc-16.0.1_p20260222

Description

The GNU Compiler Collection

Added to portage

2026-02-23

git-sources - 7.0_rc1
Ebuild name:

sys-kernel/git-sources-7.0_rc1

Description

The very latest -git version of the Linux kernel

Added to portage

2026-02-23

intellij-idea - 2025.3.3
Ebuild name:

dev-util/intellij-idea-2025.3.3

Description

A complete toolset for web, mobile and enterprise development

Added to portage

2026-02-23

ja2-stracciatella - 0.22.1-r1
Ebuild name:

games-strategy/ja2-stracciatella-0.22.1-r1

Description

An improved, cross-platform, stable Jagged Alliance 2 ru

Added to portage

2026-02-23

libcupsfilters - 2.1.1-r1
Ebuild name:

net-print/libcupsfilters-2.1.1-r1

Description

library for developing printing features, split out of cups-filte

Added to portage

2026-02-23

libfilezilla - 0.54.1
Ebuild name:

dev-libs/libfilezilla-0.54.1

Description

C++ library offering some basic functionality for platform-independent

Added to portage

2026-02-23

libselinux - 3.8.1-r3
Ebuild name:

sys-libs/libselinux-3.8.1-r3

Description

SELinux userland library

Added to portage

2026-02-23

libtracecmd - 1.5.5
Ebuild name:

dev-libs/libtracecmd-1.5.5

Description

Linux kernel tracecmd library

Added to portage

2026-02-23

libtraceevent - 1.9.0
Ebuild name:

dev-libs/libtraceevent-1.9.0

Description

Linux kernel trace event library

Added to portage

2026-02-23

mdadm - 4.5
Ebuild name:

sys-fs/mdadm-4.5

Description

Tool for running RAID systems - replacement for the raidtools

Added to portage

2026-02-23

minicom - 2.11
Ebuild name:

net-dialup/minicom-2.11

Description

Serial Communication Program

Added to portage

2026-02-23

mstflint - 4.30.0_p1-r1
Ebuild name:

sys-fabric/mstflint-4.30.0_p1-r1

Description

Mstflint - an open source version of MFT (Mellanox Firmware Tools)

Added to portage

2026-02-23

ngtcp2 - 1.20.0-r1
Ebuild name:

net-libs/ngtcp2-1.20.0-r1

Description

Implementation of the IETF QUIC Protocol

Added to portage

2026-02-23

ngx-acme - 0.3.1
Ebuild name:

www-nginx/ngx-acme-0.3.1

Description

An NGINX module with the implementation of the ACMEv2 protocol

Added to portage

2026-02-23

ophcrack-tables - 1.0-r2
Ebuild name:

app-crypt/ophcrack-tables-1.0-r2

Description

Tables available for ophcrack

Added to portage

2026-02-23

plasma-meta - 6.6.0-r1
Ebuild name:

kde-plasma/plasma-meta-6.6.0-r1

Description

Merge this to pull in all Plasma 6 packages

Added to portage

2026-02-23

platformio - 6.1.19
Ebuild name:

dev-embedded/platformio-6.1.19

Description

An open source ecosystem for IoT development

Added to portage

2026-02-23

postfix - 3.10.8
Ebuild name:

mail-mta/postfix-3.10.8

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-02-23

postfix - 3.12_pre20260218
Ebuild name:

mail-mta/postfix-3.12_pre20260218

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-02-23

pyfakefs - 6.1.2
Ebuild name:

dev-python/pyfakefs-6.1.2

Description

A fake file system that mocks the Python file system modules

Added to portage

2026-02-23

pypdf - 6.7.2
Ebuild name:

dev-python/pypdf-6.7.2

Description

Python library to work with PDF files

Added to portage

2026-02-23

requests - 2.32.5-r1
Ebuild name:

dev-python/requests-2.32.5-r1

Description

HTTP library for human beings

Added to portage

2026-02-23

rq - 2.7.0
Ebuild name:

dev-python/rq-2.7.0

Description

Simple, lightweight library for creating and processing background jobs

Added to portage

2026-02-23

scipy - 1.17.1
Ebuild name:

dev-python/scipy-1.17.1

Description

Scientific algorithms library for Python

Added to portage

2026-02-23

slack - 4.48.95
Ebuild name:

net-im/slack-4.48.95

Description

Team collaboration tool

Added to portage

2026-02-23

thermald - 2.5.11
Ebuild name:

sys-power/thermald-2.5.11

Description

Thermal daemon for Intel architectures

Added to portage

2026-02-23

trace-cmd - 3.4
Ebuild name:

dev-util/trace-cmd-3.4

Description

User-space front-end for Ftrace

Added to portage

2026-02-23

tuned - 2.27.0
Ebuild name:

sys-apps/tuned-2.27.0

Description

Daemon for monitoring and adaptive tuning of system devices

Added to portage

2026-02-23

tuxedo-control-center-bin - 2.1.23
Ebuild name:

app-laptop/tuxedo-control-center-bin-2.1.23

Description

Tool to control performance, energy, fan and comfort se

Added to portage

2026-02-23

virtualbox - 7.1.16-r1
Ebuild name:

app-emulation/virtualbox-7.1.16-r1

Description

Family of powerful x86 virtualization products for enterprise an

Added to portage

2026-02-23

virtualbox - 7.2.6-r1
Ebuild name:

app-emulation/virtualbox-7.2.6-r1

Description

Family of powerful x86 virtualization products for enterprise and

Added to portage

2026-02-23

virtualbox-kvm - 7.1.16_pre20251103-r1
Ebuild name:

app-emulation/virtualbox-kvm-7.1.16_pre20251103-r1

Description

Family of powerful x86 virtualization products f

Added to portage

2026-02-23

virtualbox-kvm - 7.2.6_pre20260201-r1
Ebuild name:

app-emulation/virtualbox-kvm-7.2.6_pre20260201-r1

Description

Family of powerful x86 virtualization products fo

Added to portage

2026-02-23

zxing-cpp - 3.0.2
Ebuild name:

media-libs/zxing-cpp-3.0.2

Description

C++ Multi-format 1D/2D barcode image processing library

Added to portage

2026-02-23

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