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:

87340

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-08-02
cpuinfo - 2026.04.13
Ebuild name:

dev-libs/cpuinfo-2026.04.13

Description

CPU INFOrmation library

Added to portage

2026-08-02

openpgp-keys-gentoo-developers - 20260727
Ebuild name:

sec-keys/openpgp-keys-gentoo-developers-20260727

Description

Gentoo Authority Keys (GLEP 79)

Added to portage

2026-08-02

openpgp-keys-gentoo-infrastructure - 20260727
Ebuild name:

sec-keys/openpgp-keys-gentoo-infrastructure-20260727

Description

Gentoo Authority Keys (GLEP 79)

Added to portage

2026-08-02

py - 1.11.0-r2
Ebuild name:

dev-python/py-1.11.0-r2

Description

library with cross-python path, ini-parsing, io, code, log facilities

Added to portage

2026-08-02

2026-08-01
alcotest - 1.9.1
Ebuild name:

dev-ml/alcotest-1.9.1

Description

A lightweight and colourful test framework

Added to portage

2026-08-01

awscli - 1.45.62
Ebuild name:

app-admin/awscli-1.45.62

Description

Universal Command Line Environment for AWS

Added to portage

2026-08-01

boto3 - 1.43.62
Ebuild name:

dev-python/boto3-1.43.62

Description

The AWS SDK for Python

Added to portage

2026-08-01

botocore - 1.43.62
Ebuild name:

dev-python/botocore-1.43.62

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-01

claude-code - 2.1.220
Ebuild name:

dev-util/claude-code-2.1.220

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-08-01

cli11 - 2.7.1
Ebuild name:

dev-cpp/cli11-2.7.1

Description

Command line parser for C++11

Added to portage

2026-08-01

compat53 - 0.15.1
Ebuild name:

dev-lua/compat53-0.15.1

Description

Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1

Added to portage

2026-08-01

cryptography - 50.0.0
Ebuild name:

dev-python/cryptography-50.0.0

Description

Library providing cryptographic recipes and primitives

Added to portage

2026-08-01

cutlass - 4.4.2
Ebuild name:

dev-libs/cutlass-4.4.2

Description

CUDA Templates for Linear Algebra Subroutines

Added to portage

2026-08-01

environs - 15.1.0
Ebuild name:

dev-python/environs-15.1.0

Description

Python library for simplified environment variable parsing

Added to portage

2026-08-01

firecracker-bin - 1.16.1
Ebuild name:

app-emulation/firecracker-bin-1.16.1

Description

Secure and fast microVMs for serverless computing (static buil

Added to portage

2026-08-01

flrig - 2.0.12
Ebuild name:

media-radio/flrig-2.0.12

Description

Transceiver control program for Amateur Radio use

Added to portage

2026-08-01

ggml - 0.18.0
Ebuild name:

sci-ml/ggml-0.18.0

Description

Tensor library for machine learning

Added to portage

2026-08-01

gtk4-layer-shell - 1.3.0
Ebuild name:

gui-libs/gtk4-layer-shell-1.3.0

Description

A library for using the Layer Shell Wayland protocol with GTK4

Added to portage

2026-08-01

guessit - 4.4.0
Ebuild name:

dev-python/guessit-4.4.0

Description

Python library for guessing information from video filenames

Added to portage

2026-08-01

ibus-typing-booster - 2.30.11
Ebuild name:

app-i18n/ibus-typing-booster-2.30.11

Description

Completion input method for IBus

Added to portage

2026-08-01

integers - 0.8.0
Ebuild name:

dev-ml/integers-0.8.0

Description

Various signed and unsigned integer types for OCaml

Added to portage

2026-08-01

jupyter-builder - 1.2.1
Ebuild name:

dev-python/jupyter-builder-1.2.1

Description

JupyterLab build tools

Added to portage

2026-08-01

just - 1.57.0
Ebuild name:

dev-build/just-1.57.0

Description

Just a command runner (with syntax inspired by 'make')

Added to portage

2026-08-01

kitty - 0.48.2
Ebuild name:

x11-terms/kitty-0.48.2

Description

Fast, feature-rich, GPU-based terminal

Added to portage

2026-08-01

kitty-shell-integration - 0.48.2
Ebuild name:

x11-terms/kitty-shell-integration-0.48.2

Description

Shell integration scripts for kitty, a GPU-based terminal

Added to portage

2026-08-01

kitty-terminfo - 0.48.2
Ebuild name:

x11-terms/kitty-terminfo-0.48.2

Description

Terminfo for kitty, a GPU-based terminal emulator

Added to portage

2026-08-01

knot - 3.5.5-r2
Ebuild name:

net-dns/knot-3.5.5-r2

Description

High-performance authoritative-only DNS server

Added to portage

2026-08-01

knot - 3.5.6
Ebuild name:

net-dns/knot-3.5.6

Description

High-performance authoritative-only DNS server

Added to portage

2026-08-01

lrzip - 0.7.1
Ebuild name:

app-arch/lrzip-0.7.1

Description

Long Range ZIP or Lzma RZIP optimized for compressing large files

Added to portage

2026-08-01

m17n-db - 1.8.14
Ebuild name:

dev-db/m17n-db-1.8.14

Description

Database for the m17n library

Added to portage

2026-08-01

matlab - 9999
Ebuild name:

app-emacs/matlab-9999

Description

Major modes for MATLAB .m and .tlc files

Added to portage

2026-08-01

mediawiki - 2.3.1
Ebuild name:

app-emacs/mediawiki-2.3.1

Description

MediaWiki client for Emacs

Added to portage

2026-08-01

meson-mode - 0.4
Ebuild name:

app-emacs/meson-mode-0.4

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-08-01

meson-mode - 9999
Ebuild name:

app-emacs/meson-mode-9999

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-08-01

mgorny-dev-scripts - 85
Ebuild name:

app-portage/mgorny-dev-scripts-85

Description

Handy scripts for ebuild development and more

Added to portage

2026-08-01

mlterm - 3.9.5
Ebuild name:

x11-terms/mlterm-3.9.5

Description

A multi-lingual terminal emulator

Added to portage

2026-08-01

nginx - 1.29.5-r2
Ebuild name:

www-servers/nginx-1.29.5-r2

Description

Added to portage

2026-08-01

nginx - 1.29.7-r3
Ebuild name:

www-servers/nginx-1.29.7-r3

Description

Added to portage

2026-08-01

nginx - 1.30.0-r2
Ebuild name:

www-servers/nginx-1.30.0-r2

Description

Added to portage

2026-08-01

nginx - 1.30.2-r2
Ebuild name:

www-servers/nginx-1.30.2-r2

Description

Added to portage

2026-08-01

nginx - 1.30.3-r2
Ebuild name:

www-servers/nginx-1.30.3-r2

Description

Added to portage

2026-08-01

nginx - 1.30.4-r1
Ebuild name:

www-servers/nginx-1.30.4-r1

Description

Added to portage

2026-08-01

nginx - 1.31.1-r2
Ebuild name:

www-servers/nginx-1.31.1-r2

Description

Added to portage

2026-08-01

nginx - 1.31.2-r2
Ebuild name:

www-servers/nginx-1.31.2-r2

Description

Added to portage

2026-08-01

nginx - 1.31.3-r1
Ebuild name:

www-servers/nginx-1.31.3-r1

Description

Added to portage

2026-08-01

ngx-acme - 0.3.1-r1
Ebuild name:

www-nginx/ngx-acme-0.3.1-r1

Description

An NGINX module with the implementation of the ACMEv2 protocol

Added to portage

2026-08-01

pebble - 5.2.1-r1
Ebuild name:

dev-python/pebble-5.2.1-r1

Description

Threading and multiprocessing eye-candy

Added to portage

2026-08-01

peewee - 4.3.0
Ebuild name:

dev-python/peewee-4.3.0

Description

Small Python ORM

Added to portage

2026-08-01

php - 8.3.33
Ebuild name:

dev-lang/php-8.3.33

Description

The PHP language runtime engine

Added to portage

2026-08-01

php - 8.4.24
Ebuild name:

dev-lang/php-8.4.24

Description

The PHP language runtime engine

Added to portage

2026-08-01

pkgcheck - 0.10.42
Ebuild name:

dev-util/pkgcheck-0.10.42

Description

pkgcore-based QA utility for ebuild repos

Added to portage

2026-08-01

pkgcore - 0.12.37
Ebuild name:

sys-apps/pkgcore-0.12.37

Description

a framework for package management

Added to portage

2026-08-01

pkgdev - 0.2.16
Ebuild name:

dev-util/pkgdev-0.2.16

Description

Collection of tools for Gentoo development

Added to portage

2026-08-01

pyglet - 2.1.16
Ebuild name:

dev-python/pyglet-2.1.16

Description

Cross-platform windowing and multimedia library for Python

Added to portage

2026-08-01

pysnmp - 7.1.28
Ebuild name:

dev-python/pysnmp-7.1.28

Description

Python SNMP library

Added to portage

2026-08-01

python-discovery - 1.5.1
Ebuild name:

dev-python/python-discovery-1.5.1

Description

Python interpreter discovery

Added to portage

2026-08-01

python-engineio - 4.13.4
Ebuild name:

dev-python/python-engineio-4.13.4

Description

Python implementation of the Engine.IO realtime server

Added to portage

2026-08-01

redis-knot - 3.5.6
Ebuild name:

net-dns/redis-knot-3.5.6

Description

Redis module for Knot DNS

Added to portage

2026-08-01

shtab - 1.9.2
Ebuild name:

dev-python/shtab-1.9.2

Description

Automagic shell tab completion for Python CLI applications

Added to portage

2026-08-01

snakeoil - 0.11.3
Ebuild name:

dev-python/snakeoil-0.11.3

Description

misc common functionality and useful optimizations

Added to portage

2026-08-01

tifffile - 2026.7.31
Ebuild name:

dev-python/tifffile-2026.7.31

Description

Read and write TIFF files

Added to portage

2026-08-01

time-machine - 3.3.0
Ebuild name:

dev-python/time-machine-3.3.0

Description

Travel through time in your tests

Added to portage

2026-08-01

traitlets - 5.16.0
Ebuild name:

dev-python/traitlets-5.16.0

Description

A configuration system for Python applications

Added to portage

2026-08-01

trakit - 0.3.0
Ebuild name:

dev-python/trakit-0.3.0

Description

Guess additional information from titles in media tracks

Added to portage

2026-08-01

translate-toolkit - 3.19.17
Ebuild name:

dev-python/translate-toolkit-3.19.17

Description

Toolkit to convert between many translation formats

Added to portage

2026-08-01

tree-sitter - 0.26.11
Ebuild name:

dev-libs/tree-sitter-0.26.11

Description

Tree-sitter is a parser generator tool and an incremental parsing libr

Added to portage

2026-08-01

tree-sitter-cli - 0.26.11
Ebuild name:

dev-util/tree-sitter-cli-0.26.11

Description

Command-line tool for creating and testing tree-sitter grammars

Added to portage

2026-08-01

trimesh - 5.0.0
Ebuild name:

dev-python/trimesh-5.0.0

Description

Python library for loading and using triangular meshes

Added to portage

2026-08-01

uv - 0.12.1
Ebuild name:

dev-python/uv-0.12.1

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-08-01

uv-build - 0.12.1
Ebuild name:

dev-python/uv-build-0.12.1

Description

PEP517 uv build backend

Added to portage

2026-08-01

wayfire - 0.11.0
Ebuild name:

gui-wm/wayfire-0.11.0

Description

compiz like 3D wayland compositor

Added to portage

2026-08-01

wayfire-plugins-extra - 0.11.0_pre20260801
Ebuild name:

gui-libs/wayfire-plugins-extra-0.11.0_pre20260801

Description

extra plugins for wayfire

Added to portage

2026-08-01

wcm - 0.11.0_pre20260801
Ebuild name:

gui-apps/wcm-0.11.0_pre20260801

Description

Wayfire Config Manager

Added to portage

2026-08-01

websockets - 17.0.1
Ebuild name:

dev-python/websockets-17.0.1

Description

Library for building WebSocket servers and clients in Python

Added to portage

2026-08-01

wf-config - 0.11.0
Ebuild name:

gui-libs/wf-config-0.11.0

Description

library for managing wayfire configuration files

Added to portage

2026-08-01

wf-shell - 0.11.0_pre20260801
Ebuild name:

gui-apps/wf-shell-0.11.0_pre20260801

Description

Compiz like 3D wayland compositor

Added to portage

2026-08-01

yq - 3.4.3-r1
Ebuild name:

app-misc/yq-3.4.3-r1

Description

Command-line YAML processor - jq wrapper for YAML documents

Added to portage

2026-08-01

yq - 4.1.2-r1
Ebuild name:

app-misc/yq-4.1.2-r1

Description

Command-line YAML processor - jq wrapper for YAML documents

Added to portage

2026-08-01

zsnes - 2.2.2
Ebuild name:

games-emulation/zsnes-2.2.2

Description

Fork of the classic Super Nintendo emulator

Added to portage

2026-08-01

zsnes - 2.2.3
Ebuild name:

games-emulation/zsnes-2.2.3

Description

Fork of the classic Super Nintendo emulator

Added to portage

2026-08-01

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