from small one page howto to huge articles all in one place
 

search text in:







Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

4131

userrating:

no votes yet


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: 3.0 (2 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back
comment this article
Please read "Why adblockers are bad".



to the forum.
:
:
other Ads
Stellenangebote
Stellenangebote
für Fach- und
Führungskräfte
www.nachoben.com
Trace My Cash
Wenn Sie sich schon immer mal gefragt haben, wo eigentlich Ihr geliebtes Bargeld geblieben ist, finden Sie hier vielleicht die Antwort.
www.tracemycash.com
Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.org
.
FeedCollector
Combine various newsfeeds to one customized webpage
www.feedcollector.org
.
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
www.reversednslookup.org

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2009-01-07
hostapd - 0.6.7
Ebuild name:

net-wireless/hostapd-0.6.7

Description

IEEE 802.11 wireless LAN Host AP daemon

Added to portage

2009-01-07

2009-01-06
bakery - 2.6.2
Ebuild name:

dev-cpp/bakery-2.6.2

Description

Bakery is a C++ Framework for creating GNOME applications using gtkmm.

Added to portage

2009-01-06

boost - 1.35.0-r4
Ebuild name:

dev-libs/boost-1.35.0-r4

Description

Boost Libraries for C++

Added to portage

2009-01-06

bullet - 2.73-r1
Ebuild name:

sci-physics/bullet-2.73-r1

Description

Continuous Collision Detection and Physics Library

Added to portage

2009-01-06

cppserv - 0.2.1
Ebuild name:

dev-cpp/cppserv-0.2.1

Description

CPPSERV is an application server providing Servlet-like API in C++ and a C++

Added to portage

2009-01-06

darkstat - 3.0.712
Ebuild name:

net-analyzer/darkstat-3.0.712

Description

darkstat is a network traffic analyzer

Added to portage

2009-01-06

deluge - 1.1.0_rc3
Ebuild name:

net-p2p/deluge-1.1.0_rc3

Description

BitTorrent client with a client/server model.

Added to portage

2009-01-06

edox-data - 0.16.8.0.2
Ebuild name:

app-doc/edox-data-0.16.8.0.2

Description

The Enlightenment online help

Added to portage

2009-01-06

enlightenment - 0.16.8.15
Ebuild name:

x11-wm/enlightenment-0.16.8.15

Description

Enlightenment Window Manager

Added to portage

2009-01-06

epplets - 0.12
Ebuild name:

x11-plugins/epplets-0.12

Description

Base files for Enlightenment epplets and some epplets

Added to portage

2009-01-06

eselect-boost - 0.2
Ebuild name:

app-admin/eselect-boost-0.2

Description

boost module for eselect

Added to portage

2009-01-06

ethemes - 0.16.8.0.3
Ebuild name:

x11-themes/ethemes-0.16.8.0.3

Description

all the official Enlightenment themes

Added to portage

2009-01-06

evilvte - 0.4.4_pre9
Ebuild name:

x11-terms/evilvte-0.4.4_pre9

Description

VTE based, super lightweight terminal emulator

Added to portage

2009-01-06

fcitx - 3.6.0_rc
Ebuild name:

app-i18n/fcitx-3.6.0_rc

Description

Free Chinese Input Toy for X. Another Chinese XIM Input Method

Added to portage

2009-01-06

gcompris - 8.4.8
Ebuild name:

games-kids/gcompris-8.4.8

Description

full featured educational application for children from 2 to 10

Added to portage

2009-01-06

gdm - 2.20.9
Ebuild name:

gnome-base/gdm-2.20.9

Description

GNOME Display Manager

Added to portage

2009-01-06

genkernel - 3.4.10.903
Ebuild name:

sys-kernel/genkernel-3.4.10.903

Description

Gentoo automatic kernel building scripts

Added to portage

2009-01-06

git-sources - 2.6.28-r8
Ebuild name:

sys-kernel/git-sources-2.6.28-r8

Description

The very latest -git version of the Linux kernel

Added to portage

2009-01-06

glade-sharp - 2.8.2
Ebuild name:

dev-dotnet/glade-sharp-2.8.2

Description

Based on the eclass

Added to portage

2009-01-06

gnome-user-share - 0.41
Ebuild name:

gnome-extra/gnome-user-share-0.41

Description

Personal file sharing for the GNOME desktop

Added to portage

2009-01-06

gtk-sharp - 2.8.2
Ebuild name:

dev-dotnet/gtk-sharp-2.8.2

Description

Gtk is a C language binding for the GTK2 toolkit and GNOME libraries

Added to portage

2009-01-06

gtk-sharp-gapi - 2.12.7-r6
Ebuild name:

dev-dotnet/gtk-sharp-gapi-2.12.7-r6

Description

GtkSharp's module

Added to portage

2009-01-06

hal - 0.5.11-r6
Ebuild name:

sys-apps/hal-0.5.11-r6

Description

Hardware Abstraction Layer

Added to portage

2009-01-06

hourglass - 0.7.1
Ebuild name:

app-office/hourglass-0.7.1

Description

A PSP (personal software process) time tracking utility written in Java

Added to portage

2009-01-06

irtrans-irserver - 5.12.08
Ebuild name:

app-misc/irtrans-irserver-5.12.08

Description

IRTrans Server

Added to portage

2009-01-06

iwl4965-ucode - 228.57.2.23
Ebuild name:

net-wireless/iwl4965-ucode-228.57.2.23

Description

Intel (R) Wireless WiFi Link 4965AGN ucode

Added to portage

2009-01-06

libdrm - 2.4.3
Ebuild name:

x11-libs/libdrm-2.4.3

Description

X.Org libdrm library

Added to portage

2009-01-06

lxde-meta - 0.3.2.1-r1
Ebuild name:

lxde-base/lxde-meta-0.3.2.1-r1

Description

Meta ebuild for LXDE, the Lightweight X11 Desktop Environment

Added to portage

2009-01-06

moon-buggy - 1.0.51
Ebuild name:

games-action/moon-buggy-1.0.51

Description

A simple console game, where you drive a car across the moon's surfa

Added to portage

2009-01-06

pyPdf - 1.12
Ebuild name:

dev-python/pyPdf-1.12

Description

Python library to work with pdf files

Added to portage

2009-01-06

qt-assistant - 4.4.2-r1
Ebuild name:

x11-libs/qt-assistant-4.4.2-r1

Description

The assistant help module for the Qt toolkit.

Added to portage

2009-01-06

qt-gui - 4.4.2-r1
Ebuild name:

x11-libs/qt-gui-4.4.2-r1

Description

The GUI module(s) for the Qt toolkit.

Added to portage

2009-01-06

quota - 3.17
Ebuild name:

sys-fs/quota-3.17

Description

Linux quota tools

Added to portage

2009-01-06

rpyc - 3.02
Ebuild name:

dev-python/rpyc-3.02

Description

Remote python call

Added to portage

2009-01-06

sdlmame - 0.129
Ebuild name:

games-emulation/sdlmame-0.129

Description

Multiple Arcade Machine Emulator (SDL)

Added to portage

2009-01-06

sofia-sip - 1.12.10
Ebuild name:

net-libs/sofia-sip-1.12.10

Description

RFC3261 compliant SIP User-Agent library

Added to portage

2009-01-06

telepathy-sofiasip - 0.5.11
Ebuild name:

net-voip/telepathy-sofiasip-0.5.11

Description

A SIP connection manager for Telepathy based around the Sofia-SI

Added to portage

2009-01-06

vdr-dxr3 - 0.2.9
Ebuild name:

media-plugins/vdr-dxr3-0.2.9

Description

VDR plugin: Use a dxr3 or hw+ card as output device

Added to portage

2009-01-06

vdr-fritzbox - 1.1.4
Ebuild name:

media-plugins/vdr-fritzbox-1.1.4

Description

VDR Plugin: Inform about incoming phone-calls and use the fritz!bo

Added to portage

2009-01-06

vdr-image - 0.3.0
Ebuild name:

media-plugins/vdr-image-0.3.0

Description

VDR plugin: display of digital images, like jpeg, tiff, png, bmp

Added to portage

2009-01-06

vdr-osdteletext - 0.7.0
Ebuild name:

media-plugins/vdr-osdteletext-0.7.0

Description

VDR Plugin: Osd-Teletext displays the teletext on the OSD

Added to portage

2009-01-06

vdr-ttxtsubs - 0.0.8
Ebuild name:

media-plugins/vdr-ttxtsubs-0.0.8

Description

VDR Plugin: displaying, recording and replaying teletext based sub

Added to portage

2009-01-06

vdradmin-am - 3.6.4
Ebuild name:

net-www/vdradmin-am-3.6.4

Description

WWW Admin for the Video Disk Recorder

Added to portage

2009-01-06

wicd - 1.5.8
Ebuild name:

net-misc/wicd-1.5.8

Description

A lightweight wired and wireless network manager for Linux

Added to portage

2009-01-06

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004 S&P Softwaredesign
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: 118.4 ms
system status display
Stellenangebote
Ärger mit Freenet.de