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:

77594

userrating:

average rating: 1.2 (8 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: 2.2 (8 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-06-24
DBIx-Migration - 0.310.0
Ebuild name:

dev-perl/DBIx-Migration-0.310.0

Description

Seamless DB schema up- and downgrades

Added to portage

2025-06-24

awscli - 1.40.41
Ebuild name:

app-admin/awscli-1.40.41

Description

Universal Command Line Environment for AWS

Added to portage

2025-06-24

bitarray - 3.4.3
Ebuild name:

dev-python/bitarray-3.4.3

Description

Efficient arrays of booleans -- C extension

Added to portage

2025-06-24

boto3 - 1.38.42
Ebuild name:

dev-python/boto3-1.38.42

Description

The AWS SDK for Python

Added to portage

2025-06-24

botocore - 1.38.42
Ebuild name:

dev-python/botocore-1.38.42

Description

Low-level, data-driven core of boto 3

Added to portage

2025-06-24

btrfs-progs - 6.15
Ebuild name:

sys-fs/btrfs-progs-6.15

Description

Btrfs filesystem utilities

Added to portage

2025-06-24

btrfsutil - 6.15
Ebuild name:

dev-python/btrfsutil-6.15

Description

Library for managing Btrfs filesystems

Added to portage

2025-06-24

clion - 2025.1.2
Ebuild name:

dev-util/clion-2025.1.2

Description

A complete toolset for C and C++ development

Added to portage

2025-06-24

ena-driver - 2.15.0
Ebuild name:

net-misc/ena-driver-2.15.0

Description

Amazon EC2 Elastic Network Adapter (ENA) kernel driver

Added to portage

2025-06-24

firefox - 128.12.0
Ebuild name:

www-client/firefox-128.12.0

Description

Firefox Web Browser

Added to portage

2025-06-24

firefox - 140.0
Ebuild name:

www-client/firefox-140.0

Description

Firefox Web Browser

Added to portage

2025-06-24

firefox-bin - 128.12.0
Ebuild name:

www-client/firefox-bin-128.12.0

Description

Firefox Web Browser

Added to portage

2025-06-24

fotema - 2.0.1
Ebuild name:

media-gfx/fotema-2.0.1

Description

Photo gallery for Linux

Added to portage

2025-06-24

gdl - 3.40.0-r2
Ebuild name:

dev-libs/gdl-3.40.0-r2

Description

GNOME docking library

Added to portage

2025-06-24

goland - 2025.1.2
Ebuild name:

dev-util/goland-2025.1.2

Description

Golang IDE by JetBrains

Added to portage

2025-06-24

haproxy - 3.2.1
Ebuild name:

net-proxy/haproxy-3.2.1

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2025-06-24

hip - 6.4.1-r1
Ebuild name:

dev-util/hip-6.4.1-r1

Description

C++ Heterogeneous-Compute Interface for Portability

Added to portage

2025-06-24

julia-bin - 1.11.5
Ebuild name:

dev-lang/julia-bin-1.11.5

Description

High-performance programming language for technical computing

Added to portage

2025-06-24

jwt - 3.1.0
Ebuild name:

dev-ruby/jwt-3.1.0

Description

A Ruby implementation of JSON Web Token draft 06

Added to portage

2025-06-24

libavif - 1.3.0
Ebuild name:

media-libs/libavif-1.3.0

Description

Library for encoding and decoding .avif files

Added to portage

2025-06-24

libopenmpt - 0.8.1
Ebuild name:

media-libs/libopenmpt-0.8.1

Description

Library to decode tracked music files (modules)

Added to portage

2025-06-24

mod_tls - 0.14.0-r1
Ebuild name:

www-apache/mod_tls-0.14.0-r1

Description

A module that uses rustls to provide a memory safe TLS implementation

Added to portage

2025-06-24

narwhals - 1.44.0
Ebuild name:

dev-python/narwhals-1.44.0

Description

Extremely lightweight compatibility layer between dataframe libraries

Added to portage

2025-06-24

openmpt123 - 0.8.1
Ebuild name:

media-sound/openmpt123-0.8.1

Description

libopenmpt-based command line player for tracked music files (modules)

Added to portage

2025-06-24

posframe - 1.4.4
Ebuild name:

app-emacs/posframe-1.4.4

Description

Pop up a frame at point

Added to portage

2025-06-24

postfix - 3.11_pre20250623
Ebuild name:

mail-mta/postfix-3.11_pre20250623

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2025-06-24

postfix - 3.9.4
Ebuild name:

mail-mta/postfix-3.9.4

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2025-06-24

pycharm-community - 2025.1.2
Ebuild name:

dev-util/pycharm-community-2025.1.2

Description

Intelligent Python IDE with unique code assistance and analysis

Added to portage

2025-06-24

pycharm-professional - 2025.1.2
Ebuild name:

dev-util/pycharm-professional-2025.1.2

Description

Intelligent Python IDE with unique code assistance and analy

Added to portage

2025-06-24

pyfakefs - 5.9.1
Ebuild name:

dev-python/pyfakefs-5.9.1

Description

A fake file system that mocks the Python file system modules

Added to portage

2025-06-24

resolv - 0.6.1
Ebuild name:

dev-ruby/resolv-0.6.1

Description

Thread-aware DNS resolver library in Ruby

Added to portage

2025-06-24

rutorrent - 5.2.10
Ebuild name:

www-apps/rutorrent-5.2.10

Description

ruTorrent is a front-end for the popular Bittorrent client rTorrent

Added to portage

2025-06-24

schroot - 1.6.13_p7
Ebuild name:

dev-util/schroot-1.6.13_p7

Description

Utility to execute commands in a chroot environment

Added to portage

2025-06-24

sooperlooper - 1.7.8_p3
Ebuild name:

media-sound/sooperlooper-1.7.8_p3

Description

Live looping sampler with immediate loop recording

Added to portage

2025-06-24

thin - 2.0.1
Ebuild name:

www-servers/thin-2.0.1

Description

A fast and very simple Ruby web server

Added to portage

2025-06-24

2025-06-23
asahi-configs - 2
Ebuild name:

sys-apps/asahi-configs-2

Description

Asahi Linux configurations

Added to portage

2025-06-23

asahi-scripts - 20250426.1
Ebuild name:

sys-apps/asahi-scripts-20250426.1

Description

Apple Silicon support scripts

Added to portage

2025-06-23

asahi-sources - 6.14.8_p1
Ebuild name:

sys-kernel/asahi-sources-6.14.8_p1

Description

Asahi Linux kernel sources

Added to portage

2025-06-23

backrefs - 5.9
Ebuild name:

dev-python/backrefs-5.9

Description

Wrapper around re or regex that adds additional back references

Added to portage

2025-06-23

bracex - 2.6
Ebuild name:

dev-python/bracex-2.6

Description

Bash style brace expansion for Python

Added to portage

2025-06-23

cucumber-html-formatter - 21.12.0
Ebuild name:

dev-util/cucumber-html-formatter-21.12.0

Description

HTML formatter for Cucumber

Added to portage

2025-06-23

curl - 8.15.0_rc1
Ebuild name:

net-misc/curl-8.15.0_rc1

Description

A Client that groks URLs

Added to portage

2025-06-23

dealii - 9.6.2-r2
Ebuild name:

sci-libs/dealii-9.6.2-r2

Description

Solving partial differential equations with the finite element method

Added to portage

2025-06-23

diffoscope - 299
Ebuild name:

dev-util/diffoscope-299

Description

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

Added to portage

2025-06-23

dulwich - 0.23.0
Ebuild name:

dev-python/dulwich-0.23.0

Description

Pure-Python implementation of the Git file formats and protocols

Added to portage

2025-06-23

engauge - 12.9
Ebuild name:

media-gfx/engauge-12.9

Description

Convert an image file showing a graph or map into numbers

Added to portage

2025-06-23

engauge - 12.9.1
Ebuild name:

media-gfx/engauge-12.9.1

Description

Convert an image file showing a graph or map into numbers

Added to portage

2025-06-23

firefox-bin - 140.0
Ebuild name:

www-client/firefox-bin-140.0

Description

Firefox Web Browser

Added to portage

2025-06-23

gamescope - 3.16.14
Ebuild name:

gui-wm/gamescope-3.16.14

Description

Efficient micro-compositor for running games

Added to portage

2025-06-23

gcc - 16.0.0_p20250622
Ebuild name:

sys-devel/gcc-16.0.0_p20250622

Description

The GNU Compiler Collection

Added to portage

2025-06-23

git-sources - 6.16_rc3
Ebuild name:

sys-kernel/git-sources-6.16_rc3

Description

The very latest -git version of the Linux kernel

Added to portage

2025-06-23

lxqt-panel - 2.2.2
Ebuild name:

lxqt-base/lxqt-panel-2.2.2

Description

LXQt desktop panel and plugins

Added to portage

2025-06-23

maturin - 1.9.0
Ebuild name:

dev-util/maturin-1.9.0

Description

Build and publish crates with pyo3, rust-cpython and cffi bindings

Added to portage

2025-06-23

openjpeg - 2.5.3-r1
Ebuild name:

media-libs/openjpeg-2.5.3-r1

Description

Open-source JPEG 2000 library

Added to portage

2025-06-23

pypdf - 5.6.1
Ebuild name:

dev-python/pypdf-5.6.1

Description

Python library to work with PDF files

Added to portage

2025-06-23

retrying - 1.3.5
Ebuild name:

dev-python/retrying-1.3.5

Description

General-purpose retrying library

Added to portage

2025-06-23

rust - 1.88.0_beta20250622
Ebuild name:

dev-lang/rust-1.88.0_beta20250622

Description

Systems programming language originally developed by Mozilla

Added to portage

2025-06-23

rust-bin - 1.88.0_beta20250622
Ebuild name:

dev-lang/rust-bin-1.88.0_beta20250622

Description

Added to portage

2025-06-23

rust-common - 1.88.0_beta20250622
Ebuild name:

dev-lang/rust-common-1.88.0_beta20250622

Description

Common files shared between multiple slots of Rust

Added to portage

2025-06-23

rust-std - 1.88.0_beta20250622
Ebuild name:

sys-devel/rust-std-1.88.0_beta20250622

Description

Rust standard library, standalone (for crossdev)

Added to portage

2025-06-23

scipy - 1.16.0
Ebuild name:

dev-python/scipy-1.16.0

Description

Scientific algorithms library for Python

Added to portage

2025-06-23

thin - 2.0.0
Ebuild name:

www-servers/thin-2.0.0

Description

A fast and very simple Ruby web server

Added to portage

2025-06-23

vopono - 0.10.13
Ebuild name:

net-vpn/vopono-0.10.13

Description

Launch applications via VPN tunnels using temporary network namespaces

Added to portage

2025-06-23

wcmatch - 10.1
Ebuild name:

dev-python/wcmatch-10.1

Description

Wildcard/glob file name matcher

Added to portage

2025-06-23

winbox - 4.0_beta24
Ebuild name:

app-admin/winbox-4.0_beta24

Description

Management Software for MikroTik RouterOS

Added to portage

2025-06-23

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 47.8 ms