Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] nanorc, ovvero nano colorato come vim
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Wed Jun 30, 2004 10:30 pm    Post subject: [TIP] nanorc, ovvero nano colorato come vim Reply with quote

mettete questo file in /etc/nanorc per avere i vostri file colorati a schermo come in vi.
nano distingue il tipo di file dall'estensione, per cui attenzione, che script.sh non verra' visualizzato come script
Nano sara' leggermente piu lento con questo file.. ma niente di visibile in un p3 800mhz.

ps. mi scuso se il file va oltre lo schermo :)
cips.

Code:
set autoindent

## Backup files to filename~
# set backup

## The directory to put the backup files in.
# set backupdir ""

## Constantly display the cursor position in the status bar.
# set const

## Use cut to end of line with ^K by default
# set cut

## Set the line length for wrapping text and justifying paragraphs.
## If fill is negative, the line length will be the screen width less
## this number.
##
# set fill -8

## Enable ~/.nano_history for saving and reading search/replace strings.
# set historylog

## Allow multiple file buffers (using ^R inserts into separate buffer).
## You must have configured with --enable-multibuffer or --enable-extra
## for this to work.
##
## set multibuffer

## 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

## Set operating directory.  nano will not read or write files outside
## this directory and its subdirectories.  Also, the current directory
## is changed to here, so files are inserted from this dir.  A blank
## string means the operating directory feature is turned off.
##
# set operatingdir ""

## Preserve the XON and XOFF keys (^Q and ^S)
# set preserve

## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them,
## otherwise a literal string.  Default:
# set quotestr "^([    ]*[\|>:}#])+"
## if you have regexps, otherwise:
# set quotestr "> "
## You can get old nano quoted-justify behavior via:
# set quotestr "(> )+"

## Fix Backspace/Delete confusion problem
# set rebinddelete

## Do extended regular expression searches by default
# set regexp

## 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

## Disallow file modification, why would you want this in an rc file? ;)
# set view

## Color setup
## Format:
## syntax "short description" ["filename regex" ...]
## color foreground,background "regex" ["regex"...]
##
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
## You may use the prefix "bright" to mean a stronger color highlight.
##
## To use multi-line regexes use the start="regex" end="regex" format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color.  If you don't want this, be sure
## to set the background color to black or white.
##
## You will in general want your comments and strings to come last,
## because syntax highlighting rules will be applied in the order they
## are read in.
##

## Here is a short example for HTML
syntax "HTML" "\.html$"
color blue start="<" end=">"
color red "&[^; ]*;"

## Here is a short example for TeX files
syntax "TeX" "\.tex$"
color green "\\.|\\[A-Za-z]*"
color magenta "[{}]"
color blue "%.*"

## Here is an example for quoted emails (under e.g. mutt)
syntax "mutt"
color green "^>.*"

## Here is an example for groff
##
syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
# The argument of .nr or .ds
 color cyan "^\.ds [^ ]*"
 color cyan "^\.nr [^ ]*"
# Single character escapes
 color brightmagenta "\\."
# Highlight the argument of \f or \s in the same color
 color brightmagenta "\\f."
 color brightmagenta "\\f\(.."
 color brightmagenta "\\s(\+|\-)?[0-9]"
## \n
 color cyan "(\\|\\\\)n."
 color cyan "(\\|\\\\)n\(.."
 color cyan start="(\\|\\\\)n\[" end="]"
# Requests
 color brightgreen "^\. *[^ ]*"
## Comments
 color yellow "^\.\\\".*$"
## Strings
 color green "(\\|\\\\)\*."
 color green "(\\|\\\\)\*\(.."
 color green start="(\\|\\\\)\*\[" end="]"
## Characters
 color brightred "\\\(.."
 color brightred start="\\\[" end="]"
## Macro arguments
 color brightcyan "\\\\\$[1-9]"

## Here is an example for perl
##
 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|study|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"

## Here is an example for Java source
##
 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,green " +$"

## Here is an example for your .nanorc
##
syntax "nanorc" "(\.|/|)nanorc$"
## highlight possible errors and parameters
color brightwhite "^ *(set|unset|syntax|color).*$"
## set, unset and syntax
color cyan "^ *(set|unset) +(autoindent|backup|const|cut|fill|historylog|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|rebinddelete|regexp|smooth|speller|suspend|tabsize|tempfile|view)"
color green "^ *(set|unset|syntax)\>"
## colors
color yellow "^ *color +(bright)?(white|black|red|blue|green|yellow|magenta|cyan)(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
color magenta "^ *color\>" "\<(start|end)="
# strings
color white "\"(\\.|[^\"])*\""
## comments
color blue "^ *#.*$"

## Here is an example for ebuilds/eclasses
##
 syntax "ebuild" "\.e(build|class)$"
## All the standard portage functions
 color brightgreen "^src_(unpack|compile|install)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
## Highlight bash related syntax
 color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
 color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
 color green "-(e|d|f|r|g|u|w|x|L)\>"
 color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
## Highlight variables ... official portage ones in red, all others in bright red
 color brightred "\$\{?[a-zA-Z_0-9]+\}?"
 color red "\<(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT)\>"
 color red "\<(S|D|T|PV|PF|P|PN|A)\>" "\<C(XX)?FLAGS\>"
## Highlight portage commands
 color magenta "\<use(_(with|enable))?\> [a-z0-9X ]*" "inherit.*"
 color brightblue "e(begin|end|conf|install|make|warn|infon?|error|patch)"
 color brightblue "\<die\>" "\<use(_(with|enable))?\>" "\<inherit\>" "\<has\>" "\<(has|best)_version\>" "\<unpack\>"
 color brightblue "\<(do|new)(ins|s?bin|doc|lib(|\.so|\.a)|man|info|exe)\>"
 color brightblue "\<do(python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
 color brightblue "prepall(|docs|info|man|strip)" "prep(info|lib|lib\.so|man|strip)"
 color brightblue "\<(|doc|ins|exe)into\>" "\<f(owners|perms)\>" "\<(exe|ins|dir)opts\>"
## Highlight common commands used in ebuilds
 color blue "\<make\>" "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\>"
## Highlight comments (doesnt work that well)
 color yellow "#.*$"
## Highlight strings (doesnt work that well)
 color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
## manpages
#
 syntax "manpage" "\.[1-9]$"
 color green "\.(S|T)H.*$"
 color brightgreen "\.(S|T)H" "\.TP"
 color brightred "\.(BR?|IP?).*$"
 color brightblue "\.(BR?|IP?|PP)"
 color brightwhite start="\\fI" end="\\fR"
 color brightwhite start="\\fB" end="\\fR"
 color yellow "\.(br|DS|RS|RE|PD)"

## Here is an example for patch files
##
 syntax "patch" "\.(patch|diff)$"
 color brightgreen "^\+.*"
 color green "^\+\+\+.*"
 color brightblue "^ .*"
 color brightred "^-.*"
 color red "^---.*"
 color brightyellow "^@@.*"
 color magenta "^diff.*"

## Here is an example for shell scripts
##
 syntax "shellscript" "\.sh$"
 color brightgreen "^[a-zA-Z_0-9]+\(\)"
 color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
 color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
 color green "-(e|d|f|r|g|u|w|x|L)\>"
 color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
 color brightblue "\<make\>" "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>"
 color brightred "\$\{?[a-zA-Z_0-9]+\}?"
 color yellow "#.*$"
 color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"

syntax "php" ".php"
color brightblue "(.*)\("

color blue "\$[a-zA-Z_0-9$]*|=*|=*|<|>|!"

color green "(var|class|function|echo|case|break|default|exit|switch|if|else|elseif|@|while) "
color green "[.,{}();]"

color red "('.*')|(\".*\")"

color brightyellow "#.*|//.*"
color brightyellow start="/\*" end="\*/"

color brightblue "(<\?php|\?>)"

syntax "python" "\.py$"
color brightblue "def [a-zA-Z_0-9]+"
color brightcyan "\<(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|print|raise|return|try|while)\>"
color brightgreen "([\"']).*?[^\\]\1"
color brightgreen start="\"\"\"" end="\"\"\""
color brightred "#.*$"

##############################################################################
#
# Syntax highlighting for mails
#
# Author:  Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2  or later
#
# Version: 2004-02-25
#
##############################################################################


syntax "mail"

# Different quotation levels
color yellow  "^(> ?> ?> ?> ?> ?)*> ?> ?> ?> ?> ?([^>][^>].*|$)"
color magenta "^(> ?> ?> ?> ?> ?)*> ?> ?> ?> ?([^>][^>].*|$)"
color cyan    "^(> ?> ?> ?> ?> ?)*> ?> ?> ?([^>][^>].*|$)"
color red     "^(> ?> ?> ?> ?> ?)*> ?> ?([^>][^>].*|$)"
color green   "^(> ?> ?> ?> ?> ?)*> ?([^>][^>].*|$)"

# Different header fields
color brightgreen   "^(From|Reply-To): .*"
color brightyellow  "^(To|Cc|Bcc): .*"
color brightred     "^Subject: .*"
color cyan          "^(In-Reply-To|References): .*"
color red           "^Organi(s|z)ation: .*"
color magenta       "^(X-Mailer|(X-)?User-Agent): .*"
color yellow        "X-(Accept-Language|GPG-Fingerprint|Location): .*"
color yellow        "X-(Spamfilter): .*"
# urls
color brightyellow "\<(finger|ftp|gopher|https?|news|telnet|tn3270)://[^ >)]*"
color brightyellow "\<mailto:[^ >)]*"

# bold
color brightgreen  "\*+[^*]+\*+"

# underlined
color brightcyan   "_+[^*]+_+"

##############################################################################
#
# Syntax highlighting for C files
#
# Author:  Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2  or later
#
# Version: 2004-02-25
#
##############################################################################

syntax "c-file" "\.(c|h)$"

# Default
color white "^.+$"

# Trigraphs
color brightyellow "\?\?[-=(\\)'<!>]"

# Decimal, cotal and hexadecimal numbers
color red "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"

# Floating point number with at least one digit before decimal point
color red "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
color red "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
# Keywords
color brightyellow "\<(break|case|continue|default|do|else|for|goto|if)\>"
color brightyellow "\<(inline|return|sizeof|switch|typedef|while)\>"

# Storage classes
color cyan "\<(auto|register|static|extern)\>"

# Type qualifiers
color cyan "\<(const|restrict|volatile)\>"

# Enumerations, structs, and unions
color cyan "\<(enum|struct|union)\>"

# Type specifiers
color cyan "\<(char|double|float|int|long|short|(un)?signed|void)\>"
color cyan "\<(_(Bool|Complex|Imaginary)|FILE|va_list|wc(trans|type)_t)\>"
color cyan "\<(u?int((_fast|_least)?(8|16|32|64)|max|ptr)|w(char|int))_t|\>"

# Preprocessor directives: Conditions
color red "^[ \t]*#(ifn?def|else|endif)\>"
color red "^[ \t]*#(if|elif)[ \t]*!?[ \t]*(defined)?\>"

# Preprocessor directive: Set line number
color yellow "^[ \t]*#line\>.*$"
color red    "^[ \t]*#line\>"

# Preprocessor: Issue error message
color yellow "^[ \t]*#error\>.*$"
color red    "^[ \t]*#error\>"

# Preprocessor: Pragma (don't ask :-)
color yellow "^[ \t]*#pragma\>.*$"
color red    "^[ \t]*#pragma\>"

# Preprocessor: Predefined macros
color red "__(LINE|FILE|func|DATE|TIME|STD(C|_HOSTED|_VERSION))__"

# Preprocessor directives: Definition
color red "^[ \t]*#(define|undef)\>"

# Preprocessor directive: File inclusion
color yellow "^[ \t]*#include[ \t]*(\"[^"]*\"|<[^>]*>)"
color red    "^[ \t]*#include\>"

# String
color yellow "L?\"(\\"|[^"])*\""
color yellow "L?'(\'|[^'])*'"

# Escapes
color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[abfnrtv'"\?\\]"

# Comments
color magenta start="/\*" end="\*/"
color magenta "//.*$"

##############################################################################
#
# Ruby syntax highlighting for Nano.
#
# Author:  Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2  or later
#
# Version: 2004-02-27
#
##############################################################################


# Automatically use for '.rb' files
syntax "ruby" ".*\.*rb$"

# General
color white ".+"

# Operators
color brightyellow "::|\*\*|!|~|\*|/|%|\+|-|&|<<|>>|\|\^|>|>=|<|<=|<=>|\|\||!=|=~|!~|&&|\+=|-=|=|\.\.|\.\.\.|\<(not|and|or)\>"

# Keywords
color brightyellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined|do|else|elsif|end|ensure|for|if|in|module)\>"
color brightyellow "\<(next|not|or|redo|rescue|retry|return|self|super|then|undef|unless|until|when|while|yield)\>"

# false, nil, true
color magenta "\<(false|nil|true)\>"

# Above must not match 'nil?'
color white "\<nil\?"

# external stuff
color brightgreen "(\<(load|require|include)|%q|%!|%Q|%r|%x)\>"

# Iterators
color brightgreen "\|\w+(,[ \t]*\w+)*\|"

# Constants
color yellow "\<[A-Z]\w*\>"

# Variables starting with '$', '@' or '@@'
color white "(\$|@@?)\w+\>"

# Function names ending in '!' or '?'
color white "\w+(!|\?)"

# Symbols
color yellow "([ \t]|^):(@|@@|\$)?\w+\>"

# Strings
color green "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"

# Backticks
color green "`(\\.|[^\\\"])*`"

# Regular expressions
color green "/(\\.|[^\\/])*/[imox]*"

# Escapes
color red "\\[0-7][0-7][0-7]|\\x[0-9a-fA-F][0-9a-fA-F]|\\[abefnrs]|(\\c|\\C-|\\M-|\\M-\\C-)."

# Expression substitution
color red "#\{[^}]*\}|#[@$]\w+"

# Simple comments
color cyan         "#([^{$@].*)?$"

# Shebang
color brightcyan   "^#!.*"

# Multiline comments
color cyan         start="^=begin" end="^=end"

##############################################################################
#
# Syntax highlighting for XML files
#
# Author:  Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2  or later
#
# Version: 2004-02-25
#
##############################################################################

syntax "ml" ".*\.([jrs]?html?|xml|sgml?)$"
color white "^.+$"
color green  start="<" end=">"
color cyan   "<[^> ]+"
color cyan   ">"
color yellow start="<!DOCTYPE" end="[/]?>"
color yellow start="<!--" end="-->"
color red    "&[^;]*;"

##############################################################################
#
# Syntax highlighting for HTTP codes
#
# Author:  Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2  or later
#
# Version: 2004-02-25
#
##############################################################################

syntax "urls"
color brightmagenta   "^.*$"
color cyan      "^(1[0-9][0-9]|20[256]|30[45]).*$"
color green      "^20[03].*$"
color brightyellow   "^(201|30[0-37]).*$"
color brightred      "^(204|[45][0-9][0-9]|666).*$"

##############################################################################
#
# Syntax highlighting for gentoo config files
#
# Author:  Luca Marturana, lucamarturana(a)gmail.com
# License: GPL 2  or later
#
# Version: 2006-04-09
#
##############################################################################

syntax "config-bash-style" "conf.d|env.d"
color white ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
color red "\{?[_A-Z0-9]+\}?="
color blue "#.*$"

syntax "make.conf" "make.conf"
color brightblue "USE=\".*\""
color brightred "[ |\"]-[^ ]*"
color white "^[^U].*"
color red "\{?[_A-Z0-9]+\}?="
color blue "#.*$"

syntax "package.use" "package.use"
color brightblue ".*"
color brightred " -[^ ]*"
color white "[^ ]*/[^ ]*"
color brightyellow "^(>|<|=|<=|>=|~)"
color yellow "#.*$"

syntax "package.keywords" "package.keywords"
color red "-[^ ]*"
color blue "~[^ ]*"
color white "[^ ]*/[^ ]*"
color brightyellow "^(>|<|=|<=|>=|~)"
color yellow "#.*$"

syntax "package.mask-unmask" "package.(mask|unmask)"
color white "[^ ]*/[^ ]*"
color brightyellow "^(>|<|=|<=|>=|~)"
color yellow "#.*$"




// edit:

2006-04-09: aggiunto Syntax highlighting for gentoo config files -- lavish
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31346
Location: here

PostPosted: Wed Jun 30, 2004 10:57 pm    Post subject: Reply with quote

Tip award 8)
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Cagnulein
l33t
l33t


Joined: 18 Sep 2003
Posts: 861
Location: Modena, Italy

PostPosted: Thu Jul 01, 2004 4:51 am    Post subject: Reply with quote

attenzione quando copiate, che tutto sia come da codice di Fonderia :)
Back to top
View user's profile Send private message
doom.it
Guru
Guru


Joined: 23 May 2003
Posts: 430
Location: Pavia, Italy

PostPosted: Thu Jul 01, 2004 6:49 am    Post subject: Reply with quote

mitico ;)
_________________
I have discovered photography. Now I can kill myself. I have nothing else to learn.
Pablo Picasso
Back to top
View user's profile Send private message
marco86
Guru
Guru


Joined: 04 Jun 2004
Posts: 574
Location: /italy/torino/valli_di_Lanzo

PostPosted: Thu Jul 01, 2004 8:18 am    Post subject: Reply with quote

spettacolo, anche su un PII 350 perdi al max un secondo....

MITICO! :o
_________________
Se il destino è contro di noi...bhe, peggio per lui....!!
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Thu Jul 01, 2004 11:16 pm    Post subject: Reply with quote

Se riesci a perdere un secondo con sta cosa il tuo pc perde colpi :)
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
.:deadhead:.
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 2963
Location: Milano, Italy

PostPosted: Wed Jul 07, 2004 7:55 am    Post subject: Reply with quote

Spettacolo davvero :D grazie Fonderia!
_________________
Proudly member of the Gentoo Documentation Project: the Italian Conspiracy ! ;)
Back to top
View user's profile Send private message
Sbriglie
n00b
n00b


Joined: 17 Jun 2004
Posts: 58

PostPosted: Wed Jul 07, 2004 12:10 pm    Post subject: Reply with quote

Meraviglioso!
:P
Back to top
View user's profile Send private message
Tiro
l33t
l33t


Joined: 14 Feb 2003
Posts: 752
Location: italy

PostPosted: Thu Jul 08, 2004 1:46 pm    Post subject: Reply with quote

MITICO! :)
Back to top
View user's profile Send private message
RenfildDust
Guru
Guru


Joined: 22 Nov 2003
Posts: 321
Location: Reggio Calabria - Catania - Roma

PostPosted: Sat Jul 10, 2004 10:37 am    Post subject: Reply with quote

E adesso chi passerà più a vim..
Cmq bisogna cancellare qualche \n per farlo funzionare correttamente..
Veramente bello!
_________________
La generazione di numeri casuali è troppo importante per essere lasciata al caso.
Back to top
View user's profile Send private message
paperp
Guru
Guru


Joined: 27 Feb 2004
Posts: 544
Location: Toscana , Italy

PostPosted: Sun Jul 25, 2004 9:23 am    Post subject: Reply with quote

Non riesco a capire ho copiato utto per benino da fonderia , ma l'unico file aperto con Nano che mi venga colorato è solo quello di configurazione----> /etc/nanorc :(
Gli altri rimangono uguali...griiiggi!!
Perchè?? :cry:
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31346
Location: here

PostPosted: Sun Jul 25, 2004 9:29 am    Post subject: Reply with quote

Che file hai aperto (che estensione)?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
paperp
Guru
Guru


Joined: 27 Feb 2004
Posts: 544
Location: Toscana , Italy

PostPosted: Sun Jul 25, 2004 9:39 am    Post subject: Reply with quote

..roba tipo /etc/X11/xorgconf oppure /etc/X11/xloadimagerc...dove cappello??
Ciao fede e buona Domenica.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31346
Location: here

PostPosted: Sun Jul 25, 2004 2:30 pm    Post subject: Re: [TIP] nanorc, ovvero nano colorato come vim Reply with quote

@paperp
FonderiaDigitale wrote:
nano distingue il tipo di file dall'estensione, per cui attenzione, che script.sh non verra' visualizzato come script

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
paperp
Guru
Guru


Joined: 27 Feb 2004
Posts: 544
Location: Toscana , Italy

PostPosted: Mon Jul 26, 2004 10:42 am    Post subject: Reply with quote

...ovvero..cosa vuol dire , come faccio a visulaizzare in maniera corretta colorata un file dipo bashrc??
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31346
Location: here

PostPosted: Mon Jul 26, 2004 11:18 am    Post subject: Reply with quote

paperp wrote:
...ovvero..cosa vuol dire , come faccio a visulaizzare in maniera corretta colorata un file dipo bashrc??

Non penso che puoi visto che per la colorazione si basa sull'estensione del file e bashrc non ha nessuna estensione
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
paperp
Guru
Guru


Joined: 27 Feb 2004
Posts: 544
Location: Toscana , Italy

PostPosted: Mon Jul 26, 2004 4:54 pm    Post subject: Reply with quote

..forse ho capito , voui dire che se aproun file di testo tipo .txt o .doc lo visulaizza coloato..giusto??!!
Avolte ci arrivo anch'io :lol:
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Mon Jul 26, 2004 6:02 pm    Post subject: Reply with quote

nano riconosce i file e fa la colorazione sintattica basandosi sull'estensione del file. un file senza estensione non viene colorato.
se e' un file che apri frequentemente, e non lo puoi rinominare (per vari motivi) io ti consiglio di fare un link simbolico al file+estensione nella stessa dir, ad es.
Code:
cd /dir
ln -s ciccio ciccio.sh
nano ciccio.sh

_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
VegetaSSJ5
Apprentice
Apprentice


Joined: 30 Dec 2005
Posts: 238

PostPosted: Thu Feb 02, 2006 4:44 pm    Post subject: Reply with quote

ho un problema

lanciando nano filename mi dice
Code:
localhost ~ # nano /etc/nanorc

Errore in /etc/nanorc alla riga 570: L'espressione regolare deve iniziare e finire con il carattere "

Premere Invio per continuare l'avvio di nano


nella riga 570 (che per capirci è l'ultima riga del file) c'è la regola color brightred "^(204|[45][0-9][0-9]|666).*$" infatti commentando questa riga non mi dà nessun errore. però mi sembra che sia scritta bene, qual'è il problema?
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Thu Feb 02, 2006 10:40 pm    Post subject: Reply with quote

quando hai copiato il testo ha mandato a capo le linee....

fai così
Code:
#cd /etc
#mv nanorc nanorc.old
#wget http://www.etilico.it/pub/nanorc

_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
Luca89
Advocate
Advocate


Joined: 27 Apr 2005
Posts: 2107
Location: Agrigento (Italy)

PostPosted: Sat Apr 08, 2006 10:14 am    Post subject: [TIP] un po' syntax highlighting per nano Reply with quote

Per chi non lo sapesse, nano permette di evidenziare la sintassi dei file che modifichiamo tramite un sistema di espressioni regolari, ecco qualche riga da aggiungere al nanorc per ottentere l'evidenziazione della sintassi per alcuni file di sistema come make.conf, /etc/portage/package.*, /etc/conf.d/* etc:

Code:
syntax "config-bash-style" "conf.d|env.d"
color white ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
color red "\{?[_A-Z0-9]+\}?="
color blue "#.*$"

syntax "make.conf" "make.conf"
color brightblue "USE=\".*\""
color brightred "[ |\"]-[^ ]*"
color white "^[^U].*"
color red "\{?[_A-Z0-9]+\}?="
color blue "#.*$"

syntax "package.use" "package.use"
color brightblue ".*"
color brightred " -[^ ]*"
color white "[^ ]*/[^ ]*"
color brightyellow "^(>|<|=|<=|>=|~)"
color yellow "#.*$"

syntax "package.keywords" "package.keywords"
color red "-[^ ]*"
color blue "~[^ ]*"
color white "[^ ]*/[^ ]*"
color brightyellow "^(>|<|=|<=|>=|~)"
color yellow "#.*$"

syntax "package.mask-unmask" "package.(mask|unmask)"
color white "[^ ]*/[^ ]*"
color brightyellow "^(>|<|=|<=|>=|~)"
color yellow "#.*$"


Queste righe vanno aggiunte alla fine del file /etc/nanorc oppure nel file ~/.nanorc. Il risultato è qualcosa di simile a questo.

[EDIT] Scusatemi, ho visto ora questo topic, se i moderatori lo ritengono opportuno si potrebbe accodare il mio post li, magari sarebbe anche meglio contattare fonderiadigitale per aggiungere le mie highlighting nel suo post.
_________________
Running Fast!
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Sat Apr 08, 2006 11:01 am    Post subject: Reply with quote

Ciao Luca89, ho fatto il thread delle due discussioni intanto ;)

//EDIT:

Ho aggiunto su autorizzazione di Fonderia Digitale Syntax highlighting for gentoo config files di Luca89
Grazie mille :)
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
Onip
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2912
Location: Parma (Italy)

PostPosted: Mon Apr 10, 2006 11:32 am    Post subject: Reply with quote

molto bello, grazie a tutti!
_________________
Linux Registered User n. 373835

Titus Lucretius Carus, De Rerum Natura - Tantum religio potuit suadere malorum
Back to top
View user's profile Send private message
bandreabis
Advocate
Advocate


Joined: 18 Feb 2005
Posts: 2495
Location: イタリアのロディで

PostPosted: Mon Sep 18, 2006 5:52 pm    Post subject: Reply with quote

1.3.12-r1 ha portato cambiamenti in /etc/nanorc.
Come ci si comporta? Con il nuovo file naturalmente non si hanno più i colori.
_________________
Il numero di post non fa di me un esperto! Anzi!
Back to top
View user's profile Send private message
Luca89
Advocate
Advocate


Joined: 27 Apr 2005
Posts: 2107
Location: Agrigento (Italy)

PostPosted: Mon Sep 18, 2006 6:42 pm    Post subject: Reply with quote

Alla fine del file /etc/nanorc ci sono delle righe commentate che cominciano per "include", decommentale per attivare la rispettiva colorazione.
_________________
Running Fast!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum