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:

82307

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
2025-12-06
blas-lapack-aux-wrapper - 3
Ebuild name:

sci-libs/blas-lapack-aux-wrapper-3

Description

BLAS/LAPACK wrappers for FlexiBLAS

Added to portage

2025-12-06

parseclj - 1.1.1
Ebuild name:

app-emacs/parseclj-1.1.1

Description

Clojure Parser for Emacs Lisp

Added to portage

2025-12-06

parseedn - 1.2.1
Ebuild name:

app-emacs/parseedn-1.2.1

Description

EDN parser for Emacs Lisp

Added to portage

2025-12-06

pyqt-builder - 1.19.1
Ebuild name:

dev-python/pyqt-builder-1.19.1

Description

The PEP 517 compliant PyQt build system

Added to portage

2025-12-06

python - 0.3.13.11
Ebuild name:

dev-lang/python-0.3.13.11

Description

Freethreading (no-GIL) version of Python programming language

Added to portage

2025-12-06

python - 0.3.14.2
Ebuild name:

dev-lang/python-0.3.14.2

Description

Freethreading (no-GIL) version of Python programming language

Added to portage

2025-12-06

python - 3.13.11
Ebuild name:

dev-lang/python-3.13.11

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2025-12-06

python - 3.14.2
Ebuild name:

dev-lang/python-3.14.2

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2025-12-06

python-tests - 0.3.13.11
Ebuild name:

dev-python/python-tests-0.3.13.11

Description

Test modules from dev-lang/python

Added to portage

2025-12-06

python-tests - 0.3.14.2
Ebuild name:

dev-python/python-tests-0.3.14.2

Description

Test modules from dev-lang/python

Added to portage

2025-12-06

python-tests - 3.13.11
Ebuild name:

dev-python/python-tests-3.13.11

Description

Test modules from dev-lang/python

Added to portage

2025-12-06

python-tests - 3.14.2
Ebuild name:

dev-python/python-tests-3.14.2

Description

Test modules from dev-lang/python

Added to portage

2025-12-06

transformers - 4.57.3
Ebuild name:

sci-ml/transformers-4.57.3

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2025-12-06

2025-12-05
android-studio - 2025.2.2.7
Ebuild name:

dev-util/android-studio-2025.2.2.7

Description

Android development environment based on IntelliJ IDEA

Added to portage

2025-12-05

apache - 2.4.66
Ebuild name:

www-servers/apache-2.4.66

Description

The Apache Web Server

Added to portage

2025-12-05

apache-tools - 2.4.66
Ebuild name:

app-admin/apache-tools-2.4.66

Description

Useful Apache tools - htdigest, htpasswd, ab, htdbm

Added to portage

2025-12-05

awscli - 1.43.9
Ebuild name:

app-admin/awscli-1.43.9

Description

Universal Command Line Environment for AWS

Added to portage

2025-12-05

boto3 - 1.42.3
Ebuild name:

dev-python/boto3-1.42.3

Description

The AWS SDK for Python

Added to portage

2025-12-05

botocore - 1.42.3
Ebuild name:

dev-python/botocore-1.42.3

Description

Low-level, data-driven core of boto 3

Added to portage

2025-12-05

cliff - 4.13.0
Ebuild name:

dev-python/cliff-4.13.0

Description

Command Line Interface Formulation Framework

Added to portage

2025-12-05

clion - 2025.2.5
Ebuild name:

dev-util/clion-2025.2.5

Description

A complete toolset for C and C++ development

Added to portage

2025-12-05

createrepo_c - 1.2.1-r3
Ebuild name:

app-arch/createrepo_c-1.2.1-r3

Description

C implementation of createrepo

Added to portage

2025-12-05

django-polymorphic - 4.2.0
Ebuild name:

dev-python/django-polymorphic-4.2.0

Description

Seamless Polymorphic Inheritance for Django Models

Added to portage

2025-12-05

duplicity - 3.0.6.3
Ebuild name:

app-backup/duplicity-3.0.6.3

Description

Secure backup system using gnupg to encrypt data

Added to portage

2025-12-05

e16-themes - 1.0.3
Ebuild name:

x11-themes/e16-themes-1.0.3

Description

All the official E16 themes

Added to portage

2025-12-05

eid-mw - 5.1.26
Ebuild name:

app-crypt/eid-mw-5.1.26

Description

Electronic Identity Card middleware supplied by the Belgian Federal Governm

Added to portage

2025-12-05

gnu-efi - 4.0.3
Ebuild name:

sys-boot/gnu-efi-4.0.3

Description

Library for build EFI Applications

Added to portage

2025-12-05

goland - 2025.2.5
Ebuild name:

dev-util/goland-2025.2.5

Description

Golang IDE by JetBrains

Added to portage

2025-12-05

greenlet - 3.3.0
Ebuild name:

dev-python/greenlet-3.3.0

Description

Lightweight in-process concurrent programming

Added to portage

2025-12-05

hypothesis - 6.148.7
Ebuild name:

dev-python/hypothesis-6.148.7

Description

A library for property based testing

Added to portage

2025-12-05

jj - 0.36.0
Ebuild name:

dev-vcs/jj-0.36.0

Description

Jujutsu - an experimental version control system

Added to portage

2025-12-05

pdf-tools - 1.1.0
Ebuild name:

app-emacs/pdf-tools-1.1.0

Description

Emacs Lisp support library for PDF documents

Added to portage

2025-12-05

pecl-xattr - 1.4.1
Ebuild name:

dev-php/pecl-xattr-1.4.1

Description

Extended attributes for PHP

Added to portage

2025-12-05

persist - 0.7
Ebuild name:

app-emacs/persist-0.7

Description

Persist variables between Emacs sessions

Added to portage

2025-12-05

persist - 0.8
Ebuild name:

app-emacs/persist-0.8

Description

Persist variables between Emacs sessions

Added to portage

2025-12-05

pf-sources - 6.17_p4
Ebuild name:

sys-kernel/pf-sources-6.17_p4

Description

Added to portage

2025-12-05

pf-sources - 6.18_p2
Ebuild name:

sys-kernel/pf-sources-6.18_p2

Description

Added to portage

2025-12-05

pkg-config - 1.6.5
Ebuild name:

dev-ruby/pkg-config-1.6.5

Description

A pkg-config implementation by Ruby

Added to portage

2025-12-05

posh - 0.14.3
Ebuild name:

app-shells/posh-0.14.3

Description

Reimplementation of Bourne shell based on pdksh

Added to portage

2025-12-05

pycharm-community - 2025.2.5
Ebuild name:

dev-util/pycharm-community-2025.2.5

Description

Intelligent Python IDE with unique code assistance and analysis

Added to portage

2025-12-05

pycharm-professional - 2025.2.5
Ebuild name:

dev-util/pycharm-professional-2025.2.5

Description

Intelligent Python IDE with unique code assistance and analy

Added to portage

2025-12-05

pyghmi - 1.6.8
Ebuild name:

dev-python/pyghmi-1.6.8

Description

A pure python implementation of IPMI protocol

Added to portage

2025-12-05

qdmr - 0.13.2
Ebuild name:

net-wireless/qdmr-0.13.2

Description

GUI application for configuring and programming cheap DMR radios

Added to portage

2025-12-05

ruff - 0.14.8
Ebuild name:

dev-util/ruff-0.14.8

Description

An extremely fast Python linter, written in Rust

Added to portage

2025-12-05

signal-desktop-bin - 7.81.0
Ebuild name:

net-im/signal-desktop-bin-7.81.0

Description

Allows you to send and receive messages of Signal Messenger on you

Added to portage

2025-12-05

sphinx - 9.0.4
Ebuild name:

dev-python/sphinx-9.0.4

Description

Python documentation generator

Added to portage

2025-12-05

swi-prolog - 10.0.0
Ebuild name:

dev-lang/swi-prolog-10.0.0

Description

Versatile implementation of the Prolog programming language

Added to portage

2025-12-05

translate-toolkit - 3.17.4
Ebuild name:

dev-python/translate-toolkit-3.17.4

Description

Toolkit to convert between many translation formats

Added to portage

2025-12-05

transmission - 4.1.0_beta4
Ebuild name:

net-p2p/transmission-4.1.0_beta4

Description

A fast, easy, and free BitTorrent client

Added to portage

2025-12-05

tsmuxer - 2.7.0
Ebuild name:

media-video/tsmuxer-2.7.0

Description

Utility to create and demux TS and M2TS files

Added to portage

2025-12-05

upterm - 0.20.0
Ebuild name:

app-misc/upterm-0.20.0

Description

Instant Terminal Sharing

Added to portage

2025-12-05

vanilla-sources - 6.18.0
Ebuild name:

sys-kernel/vanilla-sources-6.18.0

Description

Full sources for the Linux kernel

Added to portage

2025-12-05

wayfire - 0.10.1
Ebuild name:

gui-wm/wayfire-0.10.1

Description

compiz like 3D wayland compositor

Added to portage

2025-12-05

wireshark - 4.6.2-r1
Ebuild name:

net-analyzer/wireshark-4.6.2-r1

Description

Network protocol analyzer (sniffer)

Added to portage

2025-12-05

xdp-tools - 1.5.8
Ebuild name:

net-libs/xdp-tools-1.5.8

Description

The libxdp library and various tools for use with XDP

Added to portage

2025-12-05

zen-sources - 6.17.8
Ebuild name:

sys-kernel/zen-sources-6.17.8

Description

The Zen Kernel Live Sources

Added to portage

2025-12-05

zen-sources - 6.17.9
Ebuild name:

sys-kernel/zen-sources-6.17.9

Description

The Zen Kernel Live Sources

Added to portage

2025-12-05

zen-sources - 6.18
Ebuild name:

sys-kernel/zen-sources-6.18

Description

The Zen Kernel Live Sources

Added to portage

2025-12-05

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