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:

44687

userrating:

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

back



Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.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
2019-02-19
2019-02-18
absl-py - 0.7.0
Ebuild name:

dev-python/absl-py-0.7.0

Description

Abseil Python Common Libraries

Added to portage

2019-02-18

bind - 9.12.3_p1-r1
Ebuild name:

net-dns/bind-9.12.3_p1-r1

Description

BIND - Berkeley Internet Name Domain - Name Server

Added to portage

2019-02-18

ca-certificates - 20190110.3.42.1
Ebuild name:

app-misc/ca-certificates-20190110.3.42.1

Description

Common CA Certificates PEM files

Added to portage

2019-02-18

cffi - 1.12.1
Ebuild name:

dev-python/cffi-1.12.1

Description

Foreign Function Interface for Python calling C code

Added to portage

2019-02-18

chrome-binary-plugins - 72.0.3626.109
Ebuild name:

www-plugins/chrome-binary-plugins-72.0.3626.109

Description

Binary plugins from Google Chrome for use in Chromi

Added to portage

2019-02-18

chrome-binary-plugins - 73.0.3683.39_beta
Ebuild name:

www-plugins/chrome-binary-plugins-73.0.3683.39_beta

Description

Binary plugins from Google Chrome for use in Ch

Added to portage

2019-02-18

chrome-binary-plugins - 74.0.3702.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-74.0.3702.0_alpha

Description

Binary plugins from Google Chrome for use in Ch

Added to portage

2019-02-18

cmake - 3.14.0_rc2
Ebuild name:

dev-util/cmake-3.14.0_rc2

Description

Cross platform Make

Added to portage

2019-02-18

cryptography - 2.5
Ebuild name:

dev-python/cryptography-2.5

Description

Library providing cryptographic recipes and primitives

Added to portage

2019-02-18

cryptography-vectors - 2.5
Ebuild name:

dev-python/cryptography-vectors-2.5

Description

Test vectors for the cryptography package

Added to portage

2019-02-18

facter - 3.13.0
Ebuild name:

dev-ruby/facter-3.13.0

Description

Added to portage

2019-02-18

gast - 0.2.2
Ebuild name:

dev-python/gast-0.2.2

Description

A generic AST to represent Python2 and Python3's Abstract Syntax Tree (AST)

Added to portage

2019-02-18

git-sources - 5.0_rc7
Ebuild name:

sys-kernel/git-sources-5.0_rc7

Description

The very latest -git version of the Linux kernel

Added to portage

2019-02-18

google-chrome - 72.0.3626.109
Ebuild name:

www-client/google-chrome-72.0.3626.109

Description

The web browser from Google

Added to portage

2019-02-18

google-chrome-beta - 73.0.3683.39
Ebuild name:

www-client/google-chrome-beta-73.0.3683.39

Description

The web browser from Google

Added to portage

2019-02-18

google-chrome-unstable - 74.0.3702.0
Ebuild name:

www-client/google-chrome-unstable-74.0.3702.0

Description

The web browser from Google

Added to portage

2019-02-18

gromacs - 2019.1
Ebuild name:

sci-chemistry/gromacs-2019.1

Description

The ultimate molecular dynamics simulation package

Added to portage

2019-02-18

http - 4.0.5
Ebuild name:

dev-ruby/http-4.0.5

Description

An easy-to-use client library for making requests from Ruby

Added to portage

2019-02-18

jenkins-bin - 2.150.3
Ebuild name:

dev-util/jenkins-bin-2.150.3

Description

Extensible continuous integration server

Added to portage

2019-02-18

jimtcl - 0.78-r1
Ebuild name:

dev-lang/jimtcl-0.78-r1

Description

Small footprint implementation of Tcl programming language

Added to portage

2019-02-18

keras-applications - 1.0.7
Ebuild name:

sci-libs/keras-applications-1.0.7

Description

Keras deep learning library reference implementations of deep lea

Added to portage

2019-02-18

keras-preprocessing - 1.0.9
Ebuild name:

sci-libs/keras-preprocessing-1.0.9

Description

Easy data preprocessing and data augmentation for deep learning

Added to portage

2019-02-18

kodi - 17.6-r10
Ebuild name:

media-tv/kodi-17.6-r10

Description

A free and open source media-player and entertainment hub

Added to portage

2019-02-18

kodi-pvr-hts - 4.4.14
Ebuild name:

media-plugins/kodi-pvr-hts-4.4.14

Description

Tvheadend Live TV and Radio PVR client addon for Kodi

Added to portage

2019-02-18

less - 550
Ebuild name:

sys-apps/less-550

Description

Excellent text file viewer

Added to portage

2019-02-18

libdbusmenu-qt - 0.9.3_pre20160218-r3
Ebuild name:

dev-libs/libdbusmenu-qt-0.9.3_pre20160218-r3

Description

Library providing Qt implementation of DBusMenu specif

Added to portage

2019-02-18

minikube - 0.34.1
Ebuild name:

sys-cluster/minikube-0.34.1

Description

Single Node Kubernetes Cluster

Added to portage

2019-02-18

multipath-tools - 0.8.0
Ebuild name:

sys-fs/multipath-tools-0.8.0

Description

Device mapper target autoconfig

Added to portage

2019-02-18

openocd - 0.10.0-r1
Ebuild name:

dev-embedded/openocd-0.10.0-r1

Description

OpenOCD - Open On-Chip Debugger

Added to portage

2019-02-18

portage - 2.3.61
Ebuild name:

sys-apps/portage-2.3.61

Description

Portage is the package management and distribution system for Gentoo

Added to portage

2019-02-18

postfix - 3.3.2-r1
Ebuild name:

mail-mta/postfix-3.3.2-r1

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2019-02-18

pycryptodome - 3.7.3
Ebuild name:

dev-python/pycryptodome-3.7.3

Description

A self-contained cryptographic library for Python

Added to portage

2019-02-18

pyxdg - 0.26-r1
Ebuild name:

dev-python/pyxdg-0.26-r1

Description

A Python module to deal with freedesktop.org specifications

Added to portage

2019-02-18

redshift - 1.12-r2
Ebuild name:

x11-misc/redshift-1.12-r2

Description

A screen color temperature adjusting software

Added to portage

2019-02-18

rust-mode - 0.3.0_p20190125
Ebuild name:

app-emacs/rust-mode-0.3.0_p20190125

Description

A major emacs mode for editing Rust source code

Added to portage

2019-02-18

satyr - 0.27
Ebuild name:

dev-libs/satyr-0.27

Description

Satyr is a collection of low-level algorithms for program failure processing

Added to portage

2019-02-18

sysvinit - 2.94_beta
Ebuild name:

sys-apps/sysvinit-2.94_beta

Description

/sbin/init - parent of all processes

Added to portage

2019-02-18

tensorboard - 1.12.2
Ebuild name:

sci-visualization/tensorboard-1.12.2

Description

TensorFlow's Visualization Toolkit

Added to portage

2019-02-18

tensorflow - 1.13.0_rc2
Ebuild name:

sci-libs/tensorflow-1.13.0_rc2

Description

Computation framework using data flow graphs for scalable machine le

Added to portage

2019-02-18

tensorflow-estimator - 1.13.0_rc0
Ebuild name:

sci-libs/tensorflow-estimator-1.13.0_rc0

Description

A high-level TensorFlow API that greatly simplifies machin

Added to portage

2019-02-18

udiskie - 1.7.7
Ebuild name:

sys-fs/udiskie-1.7.7

Description

An automatic disk mounting service using udisks

Added to portage

2019-02-18

weechat - 2.4
Ebuild name:

net-irc/weechat-2.4

Description

Portable and multi-interface IRC client

Added to portage

2019-02-18

wine-any - 4.1
Ebuild name:

app-emulation/wine-any-4.1

Description

Free implementation of Windows(tm) on Unix, with optional external patch

Added to portage

2019-02-18

wine-d3d9 - 4.1
Ebuild name:

app-emulation/wine-d3d9-4.1

Description

Free implementation of Windows(tm) on Unix, with Gallium Nine patchset

Added to portage

2019-02-18

wine-staging - 4.1
Ebuild name:

app-emulation/wine-staging-4.1

Description

Free implementation of Windows(tm) on Unix, with Wine-Staging patchs

Added to portage

2019-02-18

wine-vanilla - 4.1
Ebuild name:

app-emulation/wine-vanilla-4.1

Description

Free implementation of Windows(tm) on Unix, without external patchse

Added to portage

2019-02-18

xcalc - 1.0.7
Ebuild name:

x11-apps/xcalc-1.0.7

Description

scientific calculator for X

Added to portage

2019-02-18

youtube-dl - 2019.02.18
Ebuild name:

net-misc/youtube-dl-2019.02.18

Description

Download videos from YouTube.com (and more sites...)

Added to portage

2019-02-18

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2018 Sascha Nitsch Unternehmensberatung UG(haftungsbeschänkt)
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: 63.7 ms