SLKBUILD en couleurs avec nano

1 minute read Published:

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 pour écrire des SLKBUILDs pour empaqueter leurs logiciels sous slackware et/ou salix.

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"


☣ laisser un commentaire ☣