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:

68178

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
2024-07-27
bash - 5.3_alpha_p20240726
Ebuild name:

app-shells/bash-5.3_alpha_p20240726

Description

The standard GNU Bourne again shell

Added to portage

2024-07-27

faudio - 24.07
Ebuild name:

app-emulation/faudio-24.07

Description

Accuracy-focused XAudio reimplementation for open platforms

Added to portage

2024-07-27

installkernel - 41
Ebuild name:

sys-kernel/installkernel-41

Description

Gentoo fork of installkernel script from debianutils

Added to portage

2024-07-27

latexdiff - 1.3.4
Ebuild name:

dev-tex/latexdiff-1.3.4

Description

Compare two latex files and mark up significant differences

Added to portage

2024-07-27

litecli - 1.11.1
Ebuild name:

dev-db/litecli-1.11.1

Description

CLI for SQLite with auto-completion and syntax highlighting

Added to portage

2024-07-27

maildrop - 3.1.7
Ebuild name:

mail-filter/maildrop-3.1.7

Description

Mail delivery agent/filter

Added to portage

2024-07-27

metee - 4.2.0
Ebuild name:

dev-libs/metee-4.2.0

Description

Cross-platform access library for Intel CSME HECI interface

Added to portage

2024-07-27

pahole - 1.27-r1
Ebuild name:

dev-util/pahole-1.27-r1

Description

pahole (Poke-a-Hole) and other DWARF utilities

Added to portage

2024-07-27

ssldump - 1.8
Ebuild name:

net-analyzer/ssldump-1.8

Description

An SSLv3/TLS network protocol analyzer

Added to portage

2024-07-27

tcping - 2.1.0
Ebuild name:

net-analyzer/tcping-2.1.0

Description

Check if a desired port is reachable via TCP

Added to portage

2024-07-27

2024-07-26
apprise - 1.8.1
Ebuild name:

dev-python/apprise-1.8.1

Description

Push Notifications that work with just about every platform

Added to portage

2024-07-26

aquamarine - 0.1.1-r1
Ebuild name:

gui-libs/aquamarine-0.1.1-r1

Description

Aquamarine is a very light linux rendering backend library

Added to portage

2024-07-26

atlas - 3.10.2-r1
Ebuild name:

sci-libs/atlas-3.10.2-r1

Description

Automatically Tuned Linear Algebra Software

Added to portage

2024-07-26

atlas - 3.10.3
Ebuild name:

sci-libs/atlas-3.10.3

Description

Automatically Tuned Linear Algebra Software

Added to portage

2024-07-26

atlas - 3.11.41
Ebuild name:

sci-libs/atlas-3.11.41

Description

Automatically Tuned Linear Algebra Software

Added to portage

2024-07-26

atpublic - 5.0
Ebuild name:

dev-python/atpublic-5.0

Description

A decorator to populate __all__ and the module globals

Added to portage

2024-07-26

awscli - 1.33.31
Ebuild name:

app-admin/awscli-1.33.31

Description

Universal Command Line Environment for AWS

Added to portage

2024-07-26

bindgen - 0.69.4
Ebuild name:

dev-util/bindgen-0.69.4

Description

Automatically generates Rust FFI bindings to C and C++ libraries.

Added to portage

2024-07-26

blueman - 2.4.3
Ebuild name:

net-wireless/blueman-2.4.3

Description

Simple and intuitive GTK+ Bluetooth Manager

Added to portage

2024-07-26

boto3 - 1.34.149
Ebuild name:

dev-python/boto3-1.34.149

Description

The AWS SDK for Python

Added to portage

2024-07-26

botocore - 1.34.149
Ebuild name:

dev-python/botocore-1.34.149

Description

Low-level, data-driven core of boto 3

Added to portage

2024-07-26

croniter - 3.0.1
Ebuild name:

dev-python/croniter-3.0.1

Description

Python module to provide iteration for datetime object

Added to portage

2024-07-26

docile - 1.4.1
Ebuild name:

dev-ruby/docile-1.4.1

Description

Turns any Ruby object into a DSL

Added to portage

2024-07-26

faraday-net_http - 3.1.1
Ebuild name:

dev-ruby/faraday-net_http-3.1.1

Description

Faraday adapter for Net

Added to portage

2024-07-26

fastfetch - 2.20.0
Ebuild name:

app-misc/fastfetch-2.20.0

Description

Fast neofetch-like system information tool

Added to portage

2024-07-26

google-api-python-client - 2.138.0
Ebuild name:

dev-python/google-api-python-client-2.138.0

Description

Google API Client for Python

Added to portage

2024-07-26

grisbi - 3.0.4
Ebuild name:

app-office/grisbi-3.0.4

Description

Grisbi is a personal accounting application for Linux

Added to portage

2024-07-26

hcloud - 2.1.0
Ebuild name:

dev-python/hcloud-2.1.0

Description

Official Hetzner Cloud python library

Added to portage

2024-07-26

ibus-m17n - 1.4.31
Ebuild name:

app-i18n/ibus-m17n-1.4.31

Description

M17N engine for IBus

Added to portage

2024-07-26

ibus-typing-booster - 2.25.14
Ebuild name:

app-i18n/ibus-typing-booster-2.25.14

Description

Completion input method for IBus

Added to portage

2024-07-26

kdsingleapplication - 1.1.0-r1
Ebuild name:

dev-libs/kdsingleapplication-1.1.0-r1

Description

KDAB's helper class for single-instance policy applications

Added to portage

2024-07-26

libcdada - 0.6.0
Ebuild name:

dev-libs/libcdada-0.6.0

Description

Basic data structures in C

Added to portage

2024-07-26

micropython - 1.23.0
Ebuild name:

dev-lang/micropython-1.23.0

Description

Python implementation for microcontrollers

Added to portage

2024-07-26

mkdocstrings - 0.25.2
Ebuild name:

dev-python/mkdocstrings-0.25.2

Description

Automatic documentation from sources, for MkDocs

Added to portage

2024-07-26

mkdocstrings-python - 1.10.7
Ebuild name:

dev-python/mkdocstrings-python-1.10.7

Description

Python handler for dev-python/mkdocstrings

Added to portage

2024-07-26

mrcfile - 1.5.3
Ebuild name:

dev-python/mrcfile-1.5.3

Description

MRC2014 file format I/O library

Added to portage

2024-07-26

munin - 2.0.76-r1
Ebuild name:

net-analyzer/munin-2.0.76-r1

Description

Munin Server Monitoring Tool

Added to portage

2024-07-26

openjdk - 8.422_p05
Ebuild name:

dev-java/openjdk-8.422_p05

Description

Open source implementation of the Java programming language

Added to portage

2024-07-26

openjdk-bin - 8.422_p05
Ebuild name:

dev-java/openjdk-bin-8.422_p05

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2024-07-26

owncloud-client - 5.2.1.13040-r1
Ebuild name:

net-misc/owncloud-client-5.2.1.13040-r1

Description

Synchronize files from ownCloud Server with your computer

Added to portage

2024-07-26

pytest - 8.3.2
Ebuild name:

dev-python/pytest-8.3.2

Description

Simple powerful testing with Python

Added to portage

2024-07-26

regress - 1.5.1
Ebuild name:

app-emacs/regress-1.5.1

Description

Regression test harness for Emacs Lisp code

Added to portage

2024-07-26

rssguard - 4.7.3
Ebuild name:

net-news/rssguard-4.7.3

Description

Simple (yet powerful) news feed reader

Added to portage

2024-07-26

simutrans - 124.1
Ebuild name:

games-simulation/simutrans-124.1

Description

A free Transport Tycoon clone

Added to portage

2024-07-26

sqlglot - 25.7.1
Ebuild name:

dev-python/sqlglot-25.7.1

Description

An easily customizable SQL parser and transpiler

Added to portage

2024-07-26

strawberry - 1.0.23-r2
Ebuild name:

media-sound/strawberry-1.0.23-r2

Description

Modern music player and library organizer based on Clementine and

Added to portage

2024-07-26

stripe - 10.5.0
Ebuild name:

dev-python/stripe-10.5.0

Description

Stripe Python bindings

Added to portage

2024-07-26

tempora - 5.7.0
Ebuild name:

dev-python/tempora-5.7.0

Description

Objects and routines pertaining to date and time

Added to portage

2024-07-26

tomcat-native - 1.3.1
Ebuild name:

dev-java/tomcat-native-1.3.1

Description

Allows Tomcat to use certain native resources for better performance

Added to portage

2024-07-26

tuxedo-drivers - 4.6.1
Ebuild name:

app-laptop/tuxedo-drivers-4.6.1

Description

Kernel modules for TUXEDO laptops

Added to portage

2024-07-26

virtualbox - 7.1.0_beta1
Ebuild name:

app-emulation/virtualbox-7.1.0_beta1

Description

Family of powerful x86 virtualization products for enterprise

Added to portage

2024-07-26

virtualbox-additions - 7.1.0_beta1
Ebuild name:

app-emulation/virtualbox-additions-7.1.0_beta1

Description

CD image containing guest additions for VirtualBox

Added to portage

2024-07-26

virtualbox-extpack-oracle - 7.1.0_beta1
Ebuild name:

app-emulation/virtualbox-extpack-oracle-7.1.0_beta1

Description

PUEL extensions for VirtualBox

Added to portage

2024-07-26

virtualbox-guest-additions - 7.1.0_beta1
Ebuild name:

app-emulation/virtualbox-guest-additions-7.1.0_beta1

Description

VirtualBox kernel modules and user-space tools

Added to portage

2024-07-26

virtualbox-modules - 7.1.0_beta1
Ebuild name:

app-emulation/virtualbox-modules-7.1.0_beta1

Description

Kernel Modules for Virtualbox

Added to portage

2024-07-26

yara-x - 0.5.0
Ebuild name:

app-forensics/yara-x-0.5.0

Description

A malware identification and classification tool

Added to portage

2024-07-26

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: 52.9 ms