SLKBUILD en couleur avec nano

2011-04-21

La coloration synthaxique peut s’avérer agréable et reposer les yeux. La voici disponible pour ceux qui utilise l’éditeur de texte nano[a] pour écrire des SLKBUILDs[b] pour empaqueter leurs logiciels sous slackware[c] et/ou Salix[d].

[a]

[b]

[c]

[d]

Vous nommez ce fichier slkbuild.nanorc et vous le mettez à cet endroit : /usr/share/nano/.

 ## SalixOS SLKBUILD files
 ##
syntax "slkbuild" "^.*SLKBUILD$"
color white start="^." end="$"
color brightwhite "=" "'" "\(" "\)" "\"" "#.*$" "\," "\{" "\}"
color brightblue "^[[:space:]]*#.*$"
color green "^.*(pkgname|pkgver|pkgrel|arch|source|sourcetemplate|docs|url|options|dotnew).*=.*$"
color brightgreen "\<(pkgname|pkgver|pkgrel|arch|source|sourcetemplate|docs|url|options|dotnew|startdir|pkg|src)\>"
color brightgreen "(\$|\$\{|\$\()(pkgname|pkgver|pkgrel|arch|source|sourcetemplate|docs|url|options|dotnew|startdir|pkg|sr)(|\}|\))"
color brightyellow "\<(slackdesc)\>"
color brightyellow "doinst\(\)"
color brightyellow "build\(\)"
color brightred "\<(configure|make|cmake|scons|waf)\>"
color red "\<(DESTDIR|PREFIX|INSTALLDIRS)\>"

Ensuite, vous éditez le fichier de configuration de nano (/home/VOUS/.nanorc) pour y ajouter :

include “/usr/share/nano/slkbuild.nanorc”

Voici un exemple de fichier ~/.nanorc :

set autoindent
unset backup
set cut
set fill -8
set matchbrackets "(<[{)>]}"
set morespace
set mouse
set nowrap
set tabsize 4
set tabstospaces
include "/usr/share/nano/slkbuild.nanorc"
include "/usr/share/nano/txt2tags.nanorc"
include "/usr/share/nano/nanorc.nanorc"
include "/usr/share/nano/c.nanorc"
include "/usr/share/nano/html.nanorc"
include "/usr/share/nano/tex.nanorc"
include "/usr/share/nano/mutt.nanorc"
include "/usr/share/nano/patch.nanorc"
include "/usr/share/nano/man.nanorc"
include "/usr/share/nano/groff.nanorc"
include "/usr/share/nano/perl.nanorc"
include "/usr/share/nano/python.nanorc"
include "/usr/share/nano/ruby.nanorc"
include "/usr/share/nano/sh.nanorc"

<--

Commentaires / Comments ?

Envoyer un email à la liste de discussion publique / Send a mail to the public Inbox


-- Copyright © 2008–2022 Frédéric Galusik - CC BY-SA 4.0 --